分页: 1 / 1

crontab命令不能运行

发表于 : 2009-12-11 11:01
wzsycit
写了个postinst脚本
内容如下:#!/bin/bash
touch /etc/update
echo "#!/bin/bash
sudo apt-get install -y --force-yes deny-ip" > /etc/update
touch /etc/cron.daily/cronfile
echo "10 4 * * * /etc/update" > /etc/cron.daily/cronfile
crontab /etc/cron.daily/cronfile
脚本运行到crontab 前面,就是不能运行crontab 命令
脚本单独运行没有错误,可以执行crontab命令

Re: crontab命令不能运行

发表于 : 2009-12-11 11:30
eexpress
你的sudo,没带密码啊。

Re: crontab命令不能运行

发表于 : 2009-12-11 11:31
kingkongmok
/etc/cron.daily/ 直接放sh文件,
/etc/crontab 才作计划。