crontab命令不能运行
发表于 : 2009-12-11 11:01
写了个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命令
内容如下:#!/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命令