perl crontab 使用

我是使用root 用户

权限是root

 

1 设置crontab

看看执行情况

crontab -e 编写root的crontab 内容设置为 

* * * * * echo "root crontab test" >> /tmp/test.txt
观察运行的情况

2 crontab 的重启
sudo /etc/init.d/cron stop;
/etc/init.d/cron start
活在 /etc/init.d/cron restart

service cron restart
3. 查看当前到运行的定时到任务
crontab -l
4 编辑 定时任务
crontab -e
5 重新选择crontab编辑器
有时候在你执行crontab -e的时候如果你是第一次执行这个命令,那么它会让你选择编辑器,如果你选择了之后想更改编辑器的时候可以用 sudo update-alternatives --config editor 这样再重新选择编辑器,重新再选择就好了


Ubuntu 9.10 cron定时执行任务



cron,是一个Linux定时执行工具,可以在无需人工干预的情况下运行作业。

       1. 关于crontab

       在Ubuntu server 9.10下,cron是被默认安装并启动的。通过/etc/crontab文件,可以看到以下内容:
       -----------------------------------------------------------------------------------------------------------------------
       # /etc/crontab: system-wide crontab
       # Unlike any other crontab you don't have to run the `cront

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值