How Do I Run a Cron Job Every Hour in Linux?
Contents

How do I schedule a cron job every 2 hours?

0 */1 * * * “At minute 0 past every hour.” 0 */2 * * * “At minute 0 past every 2nd hour.” This is the proper way to set cronjobs for every hr.

How do I run a cron job every 5 minutes in Linux?

Run a program or script every 5 or X minutes or hours

  1. Edit your cronjob file by running crontab -e command.
  2. Add the following line for an every-5-minutes interval. */5 * * * * /path/to/script-or-program.
  3. Save the file, and that is it.

7 апр. 2012 г.

Sarah Jenkins

Sarah Jenkins

Senior Technology Editor & AI Specialist

Sarah Jenkins is a veteran tech journalist with over 12 years of experience covering artificial intelligence, mobile innovations, and digital ethics. Her insights have appeared in leading technology publications worldwide.

Share this article
Twitter Facebook Pinterest