Il y a 389 articles et 19 utilisateurs inscrits (ce bandeau est défini dans MediaWiki:Sitenotice)

« Crontab » : différence entre les versions

De AJLSM
Aller à la navigation Aller à la recherche
Ctate (discussion | contributions)
Page créée avec « Voici un exemple de crontab pour college de france : <syntaxhighlight lang="bash"> # For details see man 4 crontabs # Example of job definition: # .---------------- minu... »
 
Ctate (discussion | contributions)
Aucun résumé des modifications
Ligne 1 : Ligne 1 :
Voici un exemple de crontab pour college de france :
Voici un exemple de crontab pour ad21 :
 
{{important|N'oublier pas une ligne supplémentaire à la fin}}
 
<syntaxhighlight lang="bash">
sudo crontab -e
</syntaxhighlight>


<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
Ligne 12 : Ligne 18 :
# |  |  |  |  |
# |  |  |  |  |
# *  *  *  *  *  command to be executed
# *  *  *  *  *  command to be executed
# sh traitement_img_cdf.sh <chemin absolu vers le script python> <chemin absolu vers le repertoire contenant les images> <chemin absolu vers le repertoire des images pretraitees> <chemin absolu vers le repertoire des logs>
0 */3 * * * /usr/lib/cgi-bin/awstats.pl -config=archivistic-og.cotedor.fr -update > /dev/null
0 */3 * * * /usr/lib/cgi-bin/awstats.pl -config=archivistic-rd.cotedor.fr -update > /dev/null
00 05 * * * service tomcat-prod-rd stop
00 05 * * * service tomcat-prod-og stop
02 05 * * * rm -rf /home/ajlsm/production/archivistic-rd.cotedor.fr/tomcat6/temp/*
02 05 * * * rm -rf /home/ajlsm/production/archivistic-rd.cotedor.fr/tomcat6/work/*
02 05 * * * rm -rf /home/ajlsm/production/archivistic-rd.cotedor.fr/tomcat6/bin/catalina.pid
02 05 * * * rm -rf /home/ajlsm/production/archivistic-og.cotedor.fr/tomcat6/temp/*
02 05 * * * rm -rf /home/ajlsm/production/archivistic-og.cotedor.fr/tomcat6/work/*
02 05 * * * rm -rf /home/ajlsm/production/archivistic-og.cotedor.fr/tomcat6/bin/catalina.pid
05 05 * * * service tomcat-prod-og start
05 05 * * * service tomcat-prod-rd start


00 22 * * * root sh /opt/traitement_img_cdf.sh /opt/pretraitement_images.py /cdf/images/ /cdf/images-preparees/ /var/log/
# force les bons priviléges sur les datatdir
40 00 * * * root chmod -R 777 /cdf/datadir-prod-20130213
42 00 * * * root chmod -R 777 /cdf/datadir-slecture-20130213
44 00 * * * root chmod -R 777 /cdf/datadir-preprod-20130213
00 05 * * * root service tomcat-custom stop preprod
00 05 * * * root service tomcat-custom stop prod
00 05 * * * root service tomcat-custom stop slecture
# force la suppression des catalina pid
02 05 * * * root rm -rf /var/run/catalina-*.pid
05 05 * * * root service tomcat-custom start preprod
05 05 * * * root service tomcat-custom start prod
05 05 * * * root service tomcat-custom start slecture
00 06 * * sun root sh /cdf/SavTemp/backup_pleade_preprod.sh
00 06 * * sun root sh /cdf/SavTemp/backup_pleade_prod.sh
00 06 * * sun root sh /cdf/SavTemp/backup_pleade_slecture.sh
#00 04 01 4 2 root shutdown -h now
</syntaxhighlight>
</syntaxhighlight>

Version du 6 octobre 2014 à 07:29

Voici un exemple de crontab pour ad21 :


Important :
N'oublier pas une ligne supplémentaire à la fin.
sudo crontab -e
# For details see man 4 crontabs

# Example of job definition:
# .---------------- minute (0 - 59)
# |  .------------- hour (0 - 23)
# |  |  .---------- day of month (1 - 31)
# |  |  |  .------- month (1 - 12) OR jan,feb,mar,apr ...
# |  |  |  |  .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
# |  |  |  |  |
# *  *  *  *  *  command to be executed
0 */3 * * * /usr/lib/cgi-bin/awstats.pl -config=archivistic-og.cotedor.fr -update > /dev/null
0 */3 * * * /usr/lib/cgi-bin/awstats.pl -config=archivistic-rd.cotedor.fr -update > /dev/null
00 05 * * * service tomcat-prod-rd stop
00 05 * * * service tomcat-prod-og stop
02 05 * * * rm -rf /home/ajlsm/production/archivistic-rd.cotedor.fr/tomcat6/temp/*
02 05 * * * rm -rf /home/ajlsm/production/archivistic-rd.cotedor.fr/tomcat6/work/*
02 05 * * * rm -rf /home/ajlsm/production/archivistic-rd.cotedor.fr/tomcat6/bin/catalina.pid
02 05 * * * rm -rf /home/ajlsm/production/archivistic-og.cotedor.fr/tomcat6/temp/*
02 05 * * * rm -rf /home/ajlsm/production/archivistic-og.cotedor.fr/tomcat6/work/*
02 05 * * * rm -rf /home/ajlsm/production/archivistic-og.cotedor.fr/tomcat6/bin/catalina.pid
05 05 * * * service tomcat-prod-og start
05 05 * * * service tomcat-prod-rd start