How do I schedule tasks to run automatically?

Quick Linux Tip #5:

Try: crontab -e

Info: crontab -e opens the editor for scheduled tasks. Format: minute hour day month weekday command.

Examples:

  • $ crontab -e
  • $ crontab -l
  • $ crontab -r

Note: Use journalctl -u cron to inspect active execution logs. Always use full path variables in your commands.




LinuxTeck.com
linuxteck@ubuntu:~$ crontab -e

# m h dom mon dow command
0 2 * * * /home/user/backup.sh
0 * * * * /usr/local/bin/cleanup.sh

linuxteck@ubuntu:~$

PREVIOUS ARTICLE Quick Linux Tip #04: How long does my script take and how much CPU does it use? NEXT ARTICLE Quick Linux Tip #06: What files is a specific process using?
About John Britto

John Britto Founder & Chief-Editor @LinuxTeck. A Computer Geek and Linux Intellectual having more than 20+ years of experience in Linux and Open Source technologies.

View all posts by John Britto →

Leave a Reply

Your email address will not be published.