How to run a script in crontab every Day Of Week?

Crontab expression every Day Of Week is a commonly used cron schedule. 

0 1 * * *

The following key shows how each position in the cron pattern string is interpreted:

* * * * * *
| | | | | |
| | | | | day of week
| | | | month
| | | day of month
| | hour
| minute
second (optional)

How to run a script in crontab every Day Of Week?

Cron Job lets you run a script to do a repetitive job in an efficient way, here's how you can schedule a cronjob for every Day Of Week:

Step 1: Edit your cronjob file by running "crontab -e" command

crontab -e

Step 2: Add the following line for every Day Of Week interval:

0 1 * * * /home/ubuntu/backup.sh

Step 3: Save the file. Done!

How to restart cron after change crontab?

Cron will then examine the modification time on all crontab and reload those which have changed. Thus cron need not be restarted whenever a crontab file is modified.

But if you just want to make sure its done anyway:

sudo service cron reload

or

/etc/init.d/cron reload
sudo service cron restart
sudo systemctl reload crond

Happy coding!

How to run a script in crontab every Day Of Week?
10.55 GEEK