作者gmotwm2001 (小馬怪)
看板Linux
標題[問題] etc/crontab和crontab -e
時間Fri Sep 22 19:04:13 2017
各位大大好:
我想要利用排程每天自動備份資料夾
原本是查到etc/crontab 將程式寫進去可是我怎麼試都沒辦法
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/
# 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
*/5 * * * * /program/find.sh
可直接在root 底下打 crontab -e 加入
*/5 * * * * /program/find.sh
就又可以用了,另外想問crontab -e 是不是存在/tmp/下面 但我用cd找
都找不到檔..
是不是我觀念有誤,謝謝
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 36.238.53.62
※ 文章網址: https://www.ptt.cc/bbs/Linux/M.1506078256.A.6F3.html
→ lantw44: /tmp 底下的是 crontab 程式複製出來的暫存檔 09/22 19:46
→ lantw44: 實際上檔案可能在 /var/spool/cron 之類的地方 09/22 19:47
→ kenduest: 你的 /etc/crontab 缺少使用者帳號指定 09/22 19:59
推 phoenixcx: crontab -e是依使用者帳號開啟排程 09/22 23:02
推 ddtsatan: 推 樓上 11/11 10:03