首頁 美術繪圖 | 美術設計 | 熱門標籤 | 首選 | 首頁宣傳 | 近期作品 論壇: 發表 | 美術工作 | 美術比賽 | 展覽活動 | 美術相關 | 一般討論 | 美術同好 CG 討論 :: Photoshop | Painter | 3D 行動 | AMP

【 立即註冊 】 : 更改個人資料 : : 登入

會員名稱: 登入密碼: 保持登入

Script in /etc/cron.daily (Hourly,Weekly) won't Run or Exec

發表新主題 回覆主題 討論區 Windows, Linux, Perl, PHP, C/C++, Driver, Web 理論、應用、硬體、軟體

| 1頁, 共1
人氣點閱:1909 發表人
Script in /etc/cron.daily (Hourly,Weekly) won't Run or Exec 2012-12-03 11:35
/ / /

Script in /etc/cron.daily (Hourly,Weekly) won't Run or Execute



Symptoms:
=> Script won't Run or Execute in these Ubuntu Linux Folders
/etc/cron.hourly
/etc/cron.daily
/etc/cron.weekly
/etc/cron.monthly

Possible Check-Points

1. Make sure NO /usr/sbin/anacron existed



Otherwise, we will run "anacron" first before running "run-parts"
代碼:

$ ls -l /usr/sbin/anacron
ls: cannot access /usr/sbin/anacron: No such file or directory

$ grep "*" /etc/crontab
17 *    * * *  root    cd / && run-parts --report /etc/cron.hourly
25 5    * * *  root     test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )
47 6    * * 7  root     test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly )
52 7    1 * *  root     test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly )
                        ^^^^^^^^^^^^^^^^^^^^^^^^^


2. Rename/Remove "dot" and ".sh" from your script filename



Some run-parts parameters has filename name space constraints:

e.g.
代碼:

$ cd /etc/cron.daily/
$ sudo mv daily_backup_userfolder.sh dailybackupuserfolder



3. Make your script executeable



Of course, make them with +x permission.

代碼:

$ cd /etc/cron.daily/
$ sudo chmod 755 <YOUR SCRIPT>



4. Specify proper shell directives (e.g. #!/bin/sh or #!/bin/bash)



Finally, check if there is shell directives at first line.

代碼:

$ cd /etc/cron.weekly
$ sudo vi <YOUR SCRIPT>
  # (... Add a #!/bin/sh at first line ...)


Type



繪圖畫廊設計藝廊
攝影相簿留言板
最愛收藏分類標籤
暱稱: Type
註冊: 2002-11-30
發表: 11069
來自: vovo2000.com
V幣: 900687





資訊相關理論、技術、管理、應用、產品等
發表新主題 回覆主題