1. 程式人生 > >如何用crontab每隔1分鐘執行一個命令列指令碼

如何用crontab每隔1分鐘執行一個命令列指令碼

我在/home/下面寫了一個a.sh

#!/bin/sh
echo hello > /home/hello.txt

然後在crontab -e中設定了

*/1 * * * * /home/a.sh

為何等了好幾分鐘,home下面還是沒有hello.txt呢?

指定一下用什麼執行

*/1 * * * * sh /home/a.sh
來源:https://segmentfault.com/q/1010000002516428?sort=created