Il y a 389 articles et 19 utilisateurs inscrits (ce bandeau est défini dans MediaWiki:Sitenotice)
« Crontab » : différence entre les versions
Aller à la navigation
Aller à la recherche
Aucun résumé des modifications |
Aucun résumé des modifications |
||
| (2 versions intermédiaires par le même utilisateur non affichées) | |||
| Ligne 1 : | Ligne 1 : | ||
{{important|N'oublier pas une ligne supplémentaire à la fin}} | {{important|N'oublier pas une ligne supplémentaire à la fin}} | ||
C'est aussi important à utiliser le .bash_profile ou .bashrc d'utilisateur pour démarrer tomcat avec : | |||
<syntaxhighlight lang="bash">source $HOME/.bash_profile && </syntaxhighlight> | |||
Voici un exemple de crontab pour ad21 : | |||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
| Ligne 20 : | Ligne 24 : | ||
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-og.cotedor.fr -update > /dev/null | ||
0 */3 * * * /usr/lib/cgi-bin/awstats.pl -config=archivistic-rd.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 * * * source $HOME/.bash_profile && service tomcat-prod-rd stop | ||
00 05 * * * service tomcat-prod-og stop | 00 05 * * * source $HOME/.bash_profile && 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/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/work/* | ||
| Ligne 28 : | Ligne 32 : | ||
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/work/* | ||
02 05 * * * rm -rf /home/ajlsm/production/archivistic-og.cotedor.fr/tomcat6/bin/catalina.pid | 02 05 * * * rm -rf /home/ajlsm/production/archivistic-og.cotedor.fr/tomcat6/bin/catalina.pid | ||
05 05 * * * service tomcat-prod-og start | 05 05 * * * source $HOME/.bash_profile && service tomcat-prod-og start | ||
05 05 * * * service tomcat-prod-rd start | 05 05 * * * source $HOME/.bash_profile && service tomcat-prod-rd start | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Dernière version du 12 novembre 2014 à 08:42
Important :
N'oublier pas une ligne supplémentaire à la fin.
C'est aussi important à utiliser le .bash_profile ou .bashrc d'utilisateur pour démarrer tomcat avec :
source $HOME/.bash_profile &&
Voici un exemple de crontab pour ad21 :
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 * * * source $HOME/.bash_profile && service tomcat-prod-rd stop
00 05 * * * source $HOME/.bash_profile && 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 * * * source $HOME/.bash_profile && service tomcat-prod-og start
05 05 * * * source $HOME/.bash_profile && service tomcat-prod-rd start