Training

Menu formation

De MappingDoc
Révision datée du 24 octobre 2019 à 09:22 par Jdieu (discussion | contributions) (Regular basis script example)

OPALE

ONYX

KN training plan

Process automation - Onyx server workflows - Base

  • Different way to send data to Mapping

Administration

Usual operational tasks

Command line and scripts

Regular basis script example

#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 "Archivng 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 logs Archivage des fichiers logs du répertoire de logs Mapping et de Log Custom Mapping"
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 du répertoire log_archive"
gzip $PATH_BASE_MAPPING/log_archive/log_Archive_$TIMEDATE.tar
echo "--------------------- Suppression du contenu des répertoires de logs et des fichiers temporaires --------------------------"
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 "Suppression des spools sauvegardés"
$PATH_BIN/map_cron -cleanspool -state:saved
echo "Suppression des fichiers .id , .pid , historique , context_menu  du répertoire /apps/mapping/temp de MAPPING"
$PATH_BIN/map_cron -cleanid
echo "Suppression des fichiers temporaires de plus 2 jours du répertoire /apps/mapping/temp de MAPPING"
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 {} \;

Supervision and monitoring

Unix and Linux specificities

Multi-environment management