Schedule tasks with cron
Run a script at a fixed time, with no interface.
- Edit your cron table:
crontab -e
- Each line follows the format: minute, hour, day of month, month, day of week, command.
- Examples: every 15 minutes, and every day at 3:30 am:
*/15 * * * * /home/moi/scripts/sync.sh 30 3 * * * /home/moi/scripts/sauvegarde.sh
- List your tasks:
crontab -l
- Always use absolute paths and redirect output to a file to debug.
- Modern alternative: systemd timers, more flexible for services.