Here we execute the same cronjob every workday of the week at 15 minutes past 8 (AM).
15 8 * * 1-5 /home/you/programs/scripts/cronjob_15.sh
A cronjob consist of 6 entries.
The first is Minutes (0-59)
The second is for hours (0-23)
Third is day of month (1-31)
Fourth entry is month (1-12)
Fifth is day of week (0-7)
Sixth is the path to the scriptfile to run.
Notice that in the fifth both 0 an 7 are Sundays.
10 8 * * 1-5 path/to/script
|__|___|___|__________________ Day in month
|__________________ Script to execute
Okay. So we have the information we need to build our automated backup scripts. I assume that we use the script as seen above. And that we use the second example of the cronjob also above here. Now we need to enter the job into the crontab. We can do that easliy. Write in the following in your terminal:
$ crontab -e
.. this will open the nano editor with the crontab config file.
I made two screenshots of the nano editor, you see those here:
As you can see, the bottomline in the third shot show our entry into the crontab.
When you have written the line into nano end by hitting CTRL-X. The nano editor will ask you if you want to save. Hit Y (yes), and then A (append).
Your cronjob should have been added now. You can check it by typing this:
Remember to look at:
Now your system will create a backup every workday at 15 minutes pass 8 o'clock.