etc/crontab和crontab -e - Linux

Table of Contents

各位大大好:

我想要利用排程每天自動備份資料夾

原本是查到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找
都找不到檔..

是不是我觀念有誤,謝謝



--

All Comments

Frederic avatarFrederic2017-09-25
/tmp 底下的是 crontab 程式複製出來的暫存檔
Catherine avatarCatherine2017-09-27
實際上檔案可能在 /var/spool/cron 之類的地方
Aaliyah avatarAaliyah2017-09-29
你的 /etc/crontab 缺少使用者帳號指定
Caitlin avatarCaitlin2017-10-03
crontab -e是依使用者帳號開啟排程
Thomas avatarThomas2017-10-05
https://goo.gl/BFr81X 不嫌棄了話來我的blog看
Sandy avatarSandy2017-10-09
推 樓上