How Do I Run a Script Every 5 Minutes in Linux?
Contents How Do I Run a Program Every 5 Minutes in Linux? Run a Program or Script Every 5 or X Minutes or Hours Edit Your Cronjob File by Running Crontab -E...
Contents
How do I run a program every 5 minutes in Linux?
Run a program or script every 5 or X minutes or hours
- Edit your cronjob file by running crontab -e command.
- Add the following line for an every-5-minutes interval. */5 * * * * /path/to/script-or-program.
- Save the file, and that is it.
Must Read
How do you run a script periodically in Linux?
If you want to run a command periodically, there’s 3 ways :
- using the crontab command ex. * * * * * command (run every minutes)
- using a loop like : while true; do ./my_script.sh; sleep 60; done (not precise)
- using systemd timer.