run shell script

$ chmod +x /home/lucky/myfile.sh

/etc/crontab

10 1 * * 0 root /home/lucky/myfile.sh

run every sunday at 1:10

ref

# 1. Entry: Minute when the process will be started [0-60]
# 2. Entry: Hour when the process will be started [0-23]
# 3. Entry: Day of the month when the process will be started [1-28/29/30/31]
# 4. Entry: Month of the year when the process will be started [1-12]
# 5. Entry: Weekday when the process will be started [0-6] [0 is Sunday]

crontab log

$ grep CRON /var/log/syslog

 

ref : http://askubuntu.com/questions/350861/how-to-set-a-cron-job-to-run-a-shell-script,

http://stackoverflow.com/questions/16717930/how-to-run-crontab-job-every-week-on-sunday,

http://askubuntu.com/questions/56683/where-is-the-cron-crontab-log

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s