0

我想每分钟自动使用脚本 chmod 这是我的脚本

# vim /home/crontab/chmod.sh 
#!/bin/sh
chmod +x /home

这是我的 crontab

# crontab -e 
*/5 * * * * /home/crontab/chmod.sh

我的脚本和 crontab 有什么问题?

4

1 回答 1

0

每分钟的 Cron 表达式:-

*/1 * * * * <ur command>

并且要执行你的脚本首先在你的脚本上执行 chmod。

chmod +x /home/crontab/chmod.sh

并且不要忘记在crontab 和 Shell 脚本的末尾添加一个空白的新行。

于 2013-03-07T04:27:15.663 回答