Просмотр исходного кода

Add timeouts to cron job entries

Bob Mottram 11 лет назад
Родитель
Сommit
ef31be9969
1 измененных файлов: 4 добавлений и 4 удалений
  1. 4
    4
      beaglebone.txt

+ 4
- 4
beaglebone.txt Просмотреть файл

390
 An example would look like:
390
 An example would look like:
391
 
391
 
392
 #+BEGIN_SRC: bash
392
 #+BEGIN_SRC: bash
393
-4,9,14,19,24,29,34,39,44,49,54,59 * * * * root sleep 29 ; wget -O - http://free\ dns.afraid.org/dynamic/update.php?ABCKDNRCLFHENSLKNFEGSBFLFF== >> /\ tmp/freedns_mysubdomain_us_to.log 2>&1 &
393
+4,9,14,19,24,29,34,39,44,49,54,59 * * * * root sleep 29 ; /usr/bin/timeout 120 wget -O - http://free\ dns.afraid.org/dynamic/update.php?ABCKDNRCLFHENSLKNFEGSBFLFF== >> /\ tmp/freedns_mysubdomain_us_to.log 2>&1 &
394
 #+END_SRC
394
 #+END_SRC
395
 
395
 
396
 Edit */etc/crontab* and append that to the end of the file.
396
 Edit */etc/crontab* and append that to the end of the file.
1075
 Append the following, replacing *myusername* with your username.
1075
 Append the following, replacing *myusername* with your username.
1076
 
1076
 
1077
 #+BEGIN_SRC: bash
1077
 #+BEGIN_SRC: bash
1078
-*/3 * * * * root /usr/bin/filterspam myusername
1079
-*/3 * * * * root /usr/bin/filterham myusername
1078
+*/3 * * * * root /usr/bin/timeout 120 /usr/bin/filterspam myusername
1079
+*/3 * * * * root /usr/bin/timeout 120 /usr/bin/filterham myusername
1080
 #+END_SRC
1080
 #+END_SRC
1081
 
1081
 
1082
 Save and exit.
1082
 Save and exit.
2603
 and append the following, changing mydomainname.com to whatever your domain is.
2603
 and append the following, changing mydomainname.com to whatever your domain is.
2604
 
2604
 
2605
 #+BEGIN_SRC: bash
2605
 #+BEGIN_SRC: bash
2606
-*/10 *  * * *	root	cd /var/www/mydomainname.com/htdocs; /usr/bin/php include/poller.php
2606
+*/10 *  * * *	root	cd /var/www/mydomainname.com/htdocs; /usr/bin/timeout 120 /usr/bin/php include/poller.php
2607
 #+END_SRC
2607
 #+END_SRC
2608
 
2608
 
2609
 Save and exit, then restart cron.
2609
 Save and exit, then restart cron.