如果想在 Linux 中定時執行某些任務?
crontab -l // see the list of crontab crontab -e // edit current crontab
Example situations: Sync up system time every 5 minutes.
Create a file /root/synctime.sh and set 775, the synctime.sh execute your update logic then which execute every 5 mins
*/5 * * * * /root/synctime.sh
Here is a online crontab exerciser (這裡有個線上 crontab 的練習器)
https://crontab.guru/every-weekday
沒有留言:
張貼留言