← Shell Scripting (Bash) learning path
Shell Scripting (Bash) · Module 9 of 10

Automation and scheduling

Automate backups, logs and tasks.

📖 Key ideas

  1. cron schedules scripts: crontab -e.
  2. Cron syntax: minute hour day month weekday command.
  3. Example: 0 2 * * * /home/u/backup.sh runs daily at 2 AM.
  4. tar -czf backup.tar.gz folder compresses folders.
  5. Log script output and exit codes.
💡 Real-life example: cron is an alarm clock that runs your scripts while you sleep.
cronTime-based job scheduler
crontab -eEdits scheduled jobs
tar -czfCreates gzip archive
rsyncEfficient file sync tool