VPS1Euro Dashboard Wiki

Complete client guide: infrastructure, services, account and support.

FR EN

Manage scheduled tasks with cron

Schedule automatic execution of scripts, backups and maintenance tasks.

What this tutorial does

The tutorial "Manage scheduled tasks with cron" helps you achieve this goal:

Schedule automatic execution of scripts, backups and maintenance tasks.

← Back to tutorials
1 profiles 20 steps 7 commands ~15 min

Debian/Ubuntu

  1. --- edit crontab of current user ---
  2. crontab -e
  3. --- Syntax: minute hour day month day_week command ---
  4. Every minute: * * * * * /chemin/script.sh
  5. Every day at 2 a.m.: 0 2 * * * /chemin/script.sh
  6. Every Monday at 8 a.m.: 0 8 * * 1 /chemin/script.sh
  7. The 1st of the month at midnight: 0 0 1 * * /path/script.sh
  8. Every 5 minutes: */5 * * * * /chemin/script.sh
  9. --- Best practices ---
  10. Always use absolute paths in scripts.
  11. Redirect output to a log: command >> /var/log/tache.log 2>&1
  12. Test the script manually before scheduling it.
  13. --- System Crontab (all apps) ---
  14. Edit /etc/crontab or create a file in /etc/cron.d/
  15. Format: minute hour day month dow user command
  16. --- View active crontabs ---
  17. crontab -l (current user)
  18. cat /etc/crontab (system)
  19. --- Check execution logs ---
  20. grep CRON /var/log/syslog | tail -20