浏览代码

Add timeouts to cron job entries

Bob Mottram 11 年前
父节点
当前提交
ef31be9969
共有 1 个文件被更改,包括 4 次插入4 次删除
  1. 4
    4
      beaglebone.txt

+ 4
- 4
beaglebone.txt 查看文件

@@ -390,7 +390,7 @@ Select "/dynamic DNS/" then click "/quick cron example/"
390 390
 An example would look like:
391 391
 
392 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 394
 #+END_SRC
395 395
 
396 396
 Edit */etc/crontab* and append that to the end of the file.
@@ -1075,8 +1075,8 @@ emacs /etc/crontab
1075 1075
 Append the following, replacing *myusername* with your username.
1076 1076
 
1077 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 1080
 #+END_SRC
1081 1081
 
1082 1082
 Save and exit.
@@ -2603,7 +2603,7 @@ emacs /etc/crontab
2603 2603
 and append the following, changing mydomainname.com to whatever your domain is.
2604 2604
 
2605 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 2607
 #+END_SRC
2608 2608
 
2609 2609
 Save and exit, then restart cron.