To schedule a task to be run in a specific time in Linux can be done with cron jobs. For example, you might want to run backup process at midnight or at 3:00 AM.
Open crontab file in your favorite text editor:
$ vim /etc/crontab
Let’s assume that the script to be run is
/home/theuser/backup.sh, and we want it to be called every night at 3:15 AM. In crontab, add following line to the end:
15 3 * * * /home/theuser/backup.sh
15stands for minute, which defines the “run when the minute is 15”
3stands for hour, which defines the “run when the hour is 3 (AM)”. In case of 3:00 PM, you should enter
15because crontab uses 24 hour format.
* * *are for the day, month and week accordingly. This means that the script is run every day, every month and every week. Read more about the format: Crontab Format in Linux