Run scripts at a specific time
This is a guide to automatically run scripts at a specific time.
You need to run only one command:
crontab -e
This will open the crontab file in your default editor. There you can add the following line:
1 2 3 4 5 execuatable
- Minutes (0-59 or *)
- Hours (0-23 or *)
- Days (1-31 or *)
- Month (1-12 or *)
- Day of the week(1-7 or *)
The executable can be a script or a command. For example:
0 0 * * * /home/user/backup.sh
This will run the script backup.sh every day at midnight.
Remember to make the script executable:
chmod +x /home/user/backup.sh