Training - Menu formation

Différence entre versions

De MappingDoc
(Regular basis script example)
(Regular basis script example)
Ligne 29 : Ligne 29 :
 
  #Purge script example
 
  #Purge script example
 
  #!/bin/bash
 
  #!/bin/bash
  echo "Set des paramètres d'environnement nécessaires aux traitements"
+
  echo "------------- Initialization of the parameters necessary for the execution of the script ---------------------"
 
  echo "Set environment"
 
  echo "Set environment"
 
  export MAPPING_PATH=/apps/mapping/conf/mapping.conf
 
  export MAPPING_PATH=/apps/mapping/conf/mapping.conf
  echo "Création des variables d'environnements pour le chemin des binaires Mapping"
+
  echo "Variable creation containing the path of the Mapping binaries"
 
  PATH_BIN="/apps/mapping/bin"
 
  PATH_BIN="/apps/mapping/bin"
  echo "Création des autres variables d'environnement"
+
  echo "Creation of the other variables used in the script"
 
  TIMEDATE=`date "+%Y_%m_%d_%H_%M_%S"`
 
  TIMEDATE=`date "+%Y_%m_%d_%H_%M_%S"`
  echo "Ma variablePATH_BIN :  $PATH_BIN"
+
  echo "My variable PATH_BIN :  $PATH_BIN"
 
  echo "MAPPING_PATH : $MAPPING_PATH"
 
  echo "MAPPING_PATH : $MAPPING_PATH"
  echo "Création des variables d'environnements initialisées avec le mapping.conf nécessaire à l'éxécution du script"
+
  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_LOG_BACKUP=`$PATH_BIN/map_004 PATH_LOG_BACKUP`
 
  PATH_BASE_MAPPING=`$PATH_BIN/map_004 PATH_BASE_MAPPING`
 
  PATH_BASE_MAPPING=`$PATH_BIN/map_004 PATH_BASE_MAPPING`
  echo "Ma variable PATH_LOG_BACKUP : $PATH_LOG_BACKUP"
+
  echo "My variable PATH_LOG_BACKUP : $PATH_LOG_BACKUP"
  echo "Ma variable PATH_BASE_MAPPING : $PATH_BASE_MAPPING"
+
  echo "My variable PATH_BASE_MAPPING : $PATH_BASE_MAPPING"
  echo "Ma timedate : $TIMEDATE"
+
  echo "My timedate : $TIMEDATE"
  echo "-------------------------- Archivage et compression des fichiers de logs ---------------------------------------------"
+
  echo "-------------------------- Compression and archiving of the log files/folders ---------------------------------------------"
  echo "Archivage des logs du répertoire /apps/mapping/spool/logs vers le répertoire de backup"
+
  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
 
  $PATH_BIN/map_cron -cleanlog -folder:$PATH_BASE_MAPPING/mapping_temp/log_temp
  echo "Archivage des fichiers logs du répertoire de logs Mapping et de Log Custom Mapping"
+
  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/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
 
  tar -cvf $PATH_BASE_MAPPING/log_archive/log_Archive_$TIMEDATE.tar $PATH_BASE_MAPPING/mapping_temp/log_temp

Version du 24 octobre 2019 à 09:22

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