0 */3 * * *
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)
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 3 hours:
Step 1: Edit your cronjob file by running "crontab -e" command
crontab -e
Step 2) Add the following line for every 3 hours interval:
0 */3 * * * /home/ubuntu/backup.sh
Step 3: Save the file. Done!
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!