~ crontab on ubuntu ~

| ubuntu | No Comments

先寫好個shell script,並將佢set 做可以execute

chmod 755 filename

之後去

nano /etc/crontab

建議你先set 做一分鐘run一次,睇下run 唔run 到先

*/1  *   * * *  root    /home/user/sh/backup.sh
分 時 日 月 週 執行者身份  指令串

/ 代表毎隔幾耐run 一野,而 / 前需要有 * 的,上面的指令=一分鐘run 一次

如果想2月1日0:00 send email 請如下

0 0 1 2 * mail connie < /home/happy_birthday.txt

done : )

トラックバック

このブログ記事に対するトラックバックURL:

コメント & トラックバック

No comments yet.

Comment feed

コメントする

Smiley face

April 2024
S M T W T F S
 123456
78910111213
14151617181920
21222324252627
282930