Difference between revisions of "Cron"
From A-Eskwiki
Line 1: | Line 1: | ||
De cronjobs zijn alle scripts in <code>/scripts/cron</code> die om de <code>$x</code>-tijd uitgevoerd moeten worden. | De cronjobs zijn alle scripts in <code>/scripts/cron</code> die om de <code>$x</code>-tijd uitgevoerd moeten worden. | ||
− | De lijst van alle jobs die daadwerkelijk uitgevoerd worden staan in het <code>/scripts/cron/crontab_vm-www[|-debug].webcie</code> bestand. | + | De lijst van alle jobs die daadwerkelijk uitgevoerd worden staan in het <code>/scripts/cron/crontab_vm-www[|-debug].webcie</code> bestand. |
+ | |||
+ | = Formaat = | ||
+ | Schaamteloos uit /etc/crontab gekopieerd: | ||
+ | |||
+ | <pre> | ||
+ | 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 | ||
+ | | | | | | | ||
+ | * * * * * user-name command to be executed | ||
+ | </pre> | ||
+ | |||
+ | = Nieuwe cronjob = | ||
Om een nieuwe cronjob toe te voegen of die crontab anderszins aan te passen, moet je op de juiste VM de crontab installeren: | Om een nieuwe cronjob toe te voegen of die crontab anderszins aan te passen, moet je op de juiste VM de crontab installeren: |
Revision as of 21:47, 23 February 2017
De cronjobs zijn alle scripts in /scripts/cron
die om de $x
-tijd uitgevoerd moeten worden.
De lijst van alle jobs die daadwerkelijk uitgevoerd worden staan in het /scripts/cron/crontab_vm-www[|-debug].webcie
bestand.
Formaat
Schaamteloos uit /etc/crontab gekopieerd:
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 | | | | | * * * * * user-name command to be executed
Nieuwe cronjob
Om een nieuwe cronjob toe te voegen of die crontab anderszins aan te passen, moet je op de juiste VM de crontab installeren:
ssh vm-www[|-debug] s webcie cd /srv/http/www/scripts/cron crontab -l # check dat je de goede crontab te pakken hebt crontab /scripts/cron/crontab_vm-www[|-debug].webcie # installeer die hap
Nu wordt de crontab van de huidige gebruiker geinstalleerd, en dat wil je!