"test sys_refresh_ref_cron.sh"
This commit is contained in:
parent
be221c7195
commit
d4dd113a59
@ -23,7 +23,7 @@
|
|||||||
# Ce script n'accepte *aucune* option
|
# Ce script n'accepte *aucune* option
|
||||||
#
|
#
|
||||||
# @OPT: f:force:force:1/1:false:::
|
# @OPT: f:force:force:1/1:false:::
|
||||||
# @OPT: f:show-only:show-only:1/1:false:::
|
# @OPT: f:show_only:show-only:1/1:false:::
|
||||||
#
|
#
|
||||||
#------------------------------------------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------------------------------------------
|
||||||
# Liste des erreurs:
|
# Liste des erreurs:
|
||||||
@ -122,6 +122,7 @@ function check_config
|
|||||||
fi
|
fi
|
||||||
fct_message " * DB_TABLE: ${DB_TABLE}"
|
fct_message " * DB_TABLE: ${DB_TABLE}"
|
||||||
fct_message " * Force: ${force}"
|
fct_message " * Force: ${force}"
|
||||||
|
fct_message " * Show only: ${show_only}"
|
||||||
if [ ${#TETALAB_USERS[*]} -eq 0 ]; then
|
if [ ${#TETALAB_USERS[*]} -eq 0 ]; then
|
||||||
ERROR="Aucune VM définie dans le fichier de configuration"
|
ERROR="Aucune VM définie dans le fichier de configuration"
|
||||||
fct_erreur 2
|
fct_erreur 2
|
||||||
@ -153,7 +154,7 @@ function get_db_info
|
|||||||
|
|
||||||
function clean_table
|
function clean_table
|
||||||
{
|
{
|
||||||
if [ "${force}" == "true" ]; then
|
if [ "${force}" == "true" ] && [ "${show_only}" == "false" ]; then
|
||||||
fct_message "Option -force activée: Suppression des données dans la table." -color orange
|
fct_message "Option -force activée: Suppression des données dans la table." -color orange
|
||||||
SQL="delete from ref_cron where id > 0;"
|
SQL="delete from ref_cron where id > 0;"
|
||||||
psql -q -t -h ${DB_HOST} -U ${DB_USER} -d ${DB_DATABASE} -c "${SQL}"
|
psql -q -t -h ${DB_HOST} -U ${DB_USER} -d ${DB_DATABASE} -c "${SQL}"
|
||||||
|
Loading…
Reference in New Issue
Block a user