How do you run a script periodically in Linux?

How do you run a script periodically in Linux?
Answer
If you want to run a command periodically, there’s 3 ways :
  1. using the crontab command ex. * * * * * command (run every minutes)
  2. using a loop like : while true; do ./my_script.sh; sleep 60; done (not precise)
  3. using systemd timer.
 

Tìm kiếm

Back
Top