Ligne 1 :
Ligne 1 :
− =Exemple de script de purgee=
+ === =Exemple de script de purge=== =
#Purge script example
#Purge script example
#!/bin/bash
#!/bin/bash
Version du 24 octobre 2019 à 10:09
Informations concernant le message (contribuer ) Ce message n’est pas documenté.
Si vous savez où ou comment il est utilisé, vous pouvez aider les autres traducteurs en créant sa documentation.
Définition du message (ONYX:9.0:Exploitation:Guide d'exploitation ONYX Server sur Linux )
====Exemple de script de purge==== #Purge script example #!/bin/bash echo "------------- Initialization of the parameters necessary for the execution of the script ---------------------" echo "Set environment" export MAPPING_PATH=/apps/mapping/conf/mapping.conf echo "Variable creation containing the path of the Mapping binaries" PATH_BIN="/apps/mapping/bin" echo "Creation of the other variables used in the script" TIMEDATE=`date "+%Y_%m_%d_%H_%M_%S"` echo "My variable PATH_BIN : $PATH_BIN" echo "MAPPING_PATH : $MAPPING_PATH" echo "Variable creation and population set with the content of the mapping.conf file used by the script" PATH_LOG_BACKUP=`$PATH_BIN/map_004 PATH_LOG_BACKUP` PATH_BASE_MAPPING=`$PATH_BIN/map_004 PATH_BASE_MAPPING` echo "My variable PATH_LOG_BACKUP : $PATH_LOG_BACKUP" echo "My variable PATH_BASE_MAPPING : $PATH_BASE_MAPPING" echo "My timedate : $TIMEDATE" echo "-------------------------- Compression and archiving of the log files/folders ---------------------------------------------" echo "Archiivng of the log folder /apps/mapping/spool/logs in to the log backup folder" $PATH_BIN/map_cron -cleanlog -folder:$PATH_BASE_MAPPING/mapping_temp/log_temp echo "Packaging of the content of the mapping log folder and mapping Log Custom folder" tar -cvf $PATH_BASE_MAPPING/mapping_temp/log_temp/Archive_M-Connect_$TIMEDATE.tar $PATH_BASE_MAPPING/spool/mapping_log_custom tar -cvf $PATH_BASE_MAPPING/log_archive/log_Archive_$TIMEDATE.tar $PATH_BASE_MAPPING/mapping_temp/log_temp echo "Compression of the archive log folder" gzip $PATH_BASE_MAPPING/log_archive/log_Archive_$TIMEDATE.tar echo "--------------------- Clean of the log folder and mapping log custom folder --------------------------" echo "Suppression du contenu du répertoire de log de M-Connect" rm -f $PATH_BASE_MAPPING/spool/mapping_log_custom/* echo "Suppression du contenu du répertoire de log temporaire" rm -f $PATH_BASE_MAPPING/mapping_temp/log_temp/* echo "clean of the saved spool files" $PATH_BIN/map_cron -cleanspool -state:saved echo "Clean of .id , .pid , historique , context_menu files of the mapping /apps/mapping/temp folder" $PATH_BIN/map_cron -cleanid echo "Clean of the temporally files older than 2 days of the /apps/mapping/temp folder" find $PATH_BASE_MAPPING/temp -name "*cri.tmp" -mtime +2 -exec rm -f {} \; find $PATH_BASE_MAPPING/temp -name "*ttf.tmp" -mtime +2 -exec rm -f {} \; find $PATH_BASE_MAPPING/temp -name "compress_*" -mtime +2 -exec rm -f {} \; find $PATH_BASE_MAPPING/temp -name "*.[0-9]" -mtime +2 -exec rm -f {} \; find $PATH_BASE_MAPPING/temp -name "*.[0-9][0-9]" -mtime +2 -exec rm -f {} \; find $PATH_BASE_MAPPING/temp -name "xps_*" -mtime +2 -exec rm -f {} \; find $PATH_BASE_MAPPING/temp -name "tmp_report*" -mtime +2 -exec rm -f {} \; echo "Suppression du contenu de plus de 30 jours du répertoire d'archivage /apps/mapping/log_archive" find $PATH_BASE_MAPPING/log_archive -name "*" -mtime +30 -exec rm -f {} \;
====Exemple de script de purge====
#Purge script example
#!/bin/bash
echo "------------- Initialization of the parameters necessary for the execution of the script ---------------------"
echo "Set environment"
export MAPPING_PATH=/apps/mapping/conf/mapping.conf
echo "Variable creation containing the path of the Mapping binaries"
PATH_BIN="/apps/mapping/bin"
echo "Creation of the other variables used in the script"
TIMEDATE=`date "+%Y_%m_%d_%H_%M_%S"`
echo "My variable PATH_BIN : $PATH_BIN"
echo "MAPPING_PATH : $MAPPING_PATH"
echo "Variable creation and population set with the content of the mapping.conf file used by the script"
PATH_LOG_BACKUP=`$PATH_BIN/map_004 PATH_LOG_BACKUP`
PATH_BASE_MAPPING=`$PATH_BIN/map_004 PATH_BASE_MAPPING`
echo "My variable PATH_LOG_BACKUP : $PATH_LOG_BACKUP"
echo "My variable PATH_BASE_MAPPING : $PATH_BASE_MAPPING"
echo "My timedate : $TIMEDATE"
echo "-------------------------- Compression and archiving of the log files/folders ---------------------------------------------"
echo "Archiivng of the log folder /apps/mapping/spool/logs in to the log backup folder"
$PATH_BIN/map_cron -cleanlog -folder:$PATH_BASE_MAPPING/mapping_temp/log_temp
echo "Packaging of the content of the mapping log folder and mapping Log Custom folder"
tar -cvf $PATH_BASE_MAPPING/mapping_temp/log_temp/Archive_M-Connect_$TIMEDATE.tar $PATH_BASE_MAPPING/spool/mapping_log_custom
tar -cvf $PATH_BASE_MAPPING/log_archive/log_Archive_$TIMEDATE.tar $PATH_BASE_MAPPING/mapping_temp/log_temp
echo "Compression of the archive log folder"
gzip $PATH_BASE_MAPPING/log_archive/log_Archive_$TIMEDATE.tar
echo "--------------------- Clean of the log folder and mapping log custom folder --------------------------"
echo "Suppression du contenu du répertoire de log de M-Connect"
rm -f $PATH_BASE_MAPPING/spool/mapping_log_custom/*
echo "Suppression du contenu du répertoire de log temporaire"
rm -f $PATH_BASE_MAPPING/mapping_temp/log_temp/*
echo "clean of the saved spool files"
$PATH_BIN/map_cron -cleanspool -state:saved
echo "Clean of .id , .pid , historique , context_menu files of the mapping /apps/mapping/temp folder"
$PATH_BIN/map_cron -cleanid
echo "Clean of the temporally files older than 2 days of the /apps/mapping/temp folder"
find $PATH_BASE_MAPPING/temp -name "*cri.tmp" -mtime +2 -exec rm -f {} \;
find $PATH_BASE_MAPPING/temp -name "*ttf.tmp" -mtime +2 -exec rm -f {} \;
find $PATH_BASE_MAPPING/temp -name "compress_*" -mtime +2 -exec rm -f {} \;
find $PATH_BASE_MAPPING/temp -name "*.[0-9]" -mtime +2 -exec rm -f {} \;
find $PATH_BASE_MAPPING/temp -name "*.[0-9][0-9]" -mtime +2 -exec rm -f {} \;
find $PATH_BASE_MAPPING/temp -name "xps_*" -mtime +2 -exec rm -f {} \;
find $PATH_BASE_MAPPING/temp -name "tmp_report*" -mtime +2 -exec rm -f {} \;
echo "Suppression du contenu de plus de 30 jours du répertoire d'archivage /apps/mapping/log_archive"
find $PATH_BASE_MAPPING/log_archive -name "*" -mtime +30 -exec rm -f {} \;
Traduction ====Exemple de script de purge==== #Purge script example #!/bin/bash echo "------------- Initialization of the parameters necessary for the execution of the script ---------------------" echo "Set environment" export MAPPING_PATH=/apps/mapping/conf/mapping.conf echo "Variable creation containing the path of the Mapping binaries" PATH_BIN="/apps/mapping/bin" echo "Creation of the other variables used in the script" TIMEDATE=`date "+%Y_%m_%d_%H_%M_%S"` echo "My variable PATH_BIN : $PATH_BIN" echo "MAPPING_PATH : $MAPPING_PATH" echo "Variable creation and population set with the content of the mapping.conf file used by the script" PATH_LOG_BACKUP=`$PATH_BIN/map_004 PATH_LOG_BACKUP` PATH_BASE_MAPPING=`$PATH_BIN/map_004 PATH_BASE_MAPPING` echo "My variable PATH_LOG_BACKUP : $PATH_LOG_BACKUP" echo "My variable PATH_BASE_MAPPING : $PATH_BASE_MAPPING" echo "My timedate : $TIMEDATE" echo "-------------------------- Compression and archiving of the log files/folders ---------------------------------------------" echo "Archiivng of the log folder /apps/mapping/spool/logs in to the log backup folder" $PATH_BIN/map_cron -cleanlog -folder:$PATH_BASE_MAPPING/mapping_temp/log_temp echo "Packaging of the content of the mapping log folder and mapping Log Custom folder" tar -cvf $PATH_BASE_MAPPING/mapping_temp/log_temp/Archive_M-Connect_$TIMEDATE.tar $PATH_BASE_MAPPING/spool/mapping_log_custom tar -cvf $PATH_BASE_MAPPING/log_archive/log_Archive_$TIMEDATE.tar $PATH_BASE_MAPPING/mapping_temp/log_temp echo "Compression of the archive log folder" gzip $PATH_BASE_MAPPING/log_archive/log_Archive_$TIMEDATE.tar echo "--------------------- Clean of the log folder and mapping log custom folder --------------------------" echo "Suppression du contenu du répertoire de log de M-Connect" rm -f $PATH_BASE_MAPPING/spool/mapping_log_custom/* echo "Suppression du contenu du répertoire de log temporaire" rm -f $PATH_BASE_MAPPING/mapping_temp/log_temp/* echo "clean of the saved spool files" $PATH_BIN/map_cron -cleanspool -state:saved echo "Clean of .id , .pid , historique , context_menu files of the mapping /apps/mapping/temp folder" $PATH_BIN/map_cron -cleanid echo "Clean of the temporally files older than 2 days of the /apps/mapping/temp folder" find $PATH_BASE_MAPPING/temp -name "*cri.tmp" -mtime +2 -exec rm -f {} \; find $PATH_BASE_MAPPING/temp -name "*ttf.tmp" -mtime +2 -exec rm -f {} \; find $PATH_BASE_MAPPING/temp -name "compress_*" -mtime +2 -exec rm -f {} \; find $PATH_BASE_MAPPING/temp -name "*.[0-9]" -mtime +2 -exec rm -f {} \; find $PATH_BASE_MAPPING/temp -name "*.[0-9][0-9]" -mtime +2 -exec rm -f {} \; find $PATH_BASE_MAPPING/temp -name "xps_*" -mtime +2 -exec rm -f {} \; echo "Suppression du contenu de plus de 30 jours du répertoire d'archivage /apps/mapping/log_archive" find $PATH_BASE_MAPPING/log_archive -name "*" -mtime +30 -exec rm -f {} \; Exemple de script de purge
#Purge script example
#!/bin/bash
echo "------------- Initialization of the parameters necessary for the execution of the script ---------------------"
echo "Set environment"
export MAPPING_PATH=/apps/mapping/conf/mapping.conf
echo "Variable creation containing the path of the Mapping binaries"
PATH_BIN="/apps/mapping/bin"
echo "Creation of the other variables used in the script"
TIMEDATE=`date "+%Y_%m_%d_%H_%M_%S"`
echo "My variable PATH_BIN : $PATH_BIN"
echo "MAPPING_PATH : $MAPPING_PATH"
echo "Variable creation and population set with the content of the mapping.conf file used by the script"
PATH_LOG_BACKUP=`$PATH_BIN/map_004 PATH_LOG_BACKUP`
PATH_BASE_MAPPING=`$PATH_BIN/map_004 PATH_BASE_MAPPING`
echo "My variable PATH_LOG_BACKUP : $PATH_LOG_BACKUP"
echo "My variable PATH_BASE_MAPPING : $PATH_BASE_MAPPING"
echo "My timedate : $TIMEDATE"
echo "-------------------------- Compression and archiving of the log files/folders ---------------------------------------------"
echo "Archiivng of the log folder /apps/mapping/spool/logs in to the log backup folder"
$PATH_BIN/map_cron -cleanlog -folder:$PATH_BASE_MAPPING/mapping_temp/log_temp
echo "Packaging of the content of the mapping log folder and mapping Log Custom folder"
tar -cvf $PATH_BASE_MAPPING/mapping_temp/log_temp/Archive_M-Connect_$TIMEDATE.tar $PATH_BASE_MAPPING/spool/mapping_log_custom
tar -cvf $PATH_BASE_MAPPING/log_archive/log_Archive_$TIMEDATE.tar $PATH_BASE_MAPPING/mapping_temp/log_temp
echo "Compression of the archive log folder"
gzip $PATH_BASE_MAPPING/log_archive/log_Archive_$TIMEDATE.tar
echo "--------------------- Clean of the log folder and mapping log custom folder --------------------------"
echo "Suppression du contenu du répertoire de log de M-Connect"
rm -f $PATH_BASE_MAPPING/spool/mapping_log_custom/*
echo "Suppression du contenu du répertoire de log temporaire"
rm -f $PATH_BASE_MAPPING/mapping_temp/log_temp/*
echo "clean of the saved spool files"
$PATH_BIN/map_cron -cleanspool -state:saved
echo "Clean of .id , .pid , historique , context_menu files of the mapping /apps/mapping/temp folder"
$PATH_BIN/map_cron -cleanid
echo "Clean of the temporally files older than 2 days of the /apps/mapping/temp folder"
find $PATH_BASE_MAPPING/temp -name "*cri.tmp" -mtime +2 -exec rm -f {} \;
find $PATH_BASE_MAPPING/temp -name "*ttf.tmp" -mtime +2 -exec rm -f {} \;
find $PATH_BASE_MAPPING/temp -name "compress_*" -mtime +2 -exec rm -f {} \;
find $PATH_BASE_MAPPING/temp -name "*.[0-9]" -mtime +2 -exec rm -f {} \;
find $PATH_BASE_MAPPING/temp -name "*.[0-9][0-9]" -mtime +2 -exec rm -f {} \;
find $PATH_BASE_MAPPING/temp -name "xps_*" -mtime +2 -exec rm -f {} \;
echo "Suppression du contenu de plus de 30 jours du répertoire d'archivage /apps/mapping/log_archive"
find $PATH_BASE_MAPPING/log_archive -name "*" -mtime +30 -exec rm -f {} \;