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
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... » |
Aucun résumé des modifications |
||
| (4 versions intermédiaires par le même utilisateur non affichées) | |||
| Ligne 1 : | Ligne 1 : | ||
Voici un exemple de crontab pour | |||
{{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"> | |||
sudo crontab -e | |||
</syntaxhighlight> | |||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
| Ligne 12 : | Ligne 22 : | ||
# | | | | | | # | | | | | | ||
# * * * * * command to be executed | # * * * * * 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 | |||
</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