不带crontab -e的Crontab [英] Crontab without crontab -e

查看:226
本文介绍了不带crontab -e的Crontab的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想通过在服务器上执行以下操作来添加crontab时间表:

I would like to add a crontab schedule by doing this in my server:

echo 30 * * * * / home / my / var / dir / to / script / var / etc / etc / etc /> crontab -e

echo "30 * * * * /home/my/var/dir/to/script /var/etc/etc/etc/" > crontab -e

有没有一种方法可以不用执行crontab -e然后输入命令?

Is there a way to do this without going doing crontab -e and then typing in the command?

推荐答案

可以尝试

1)nano /etc/crontab (or any other editor, e.g. emacs)
2)echo "30 * * * * /home/my/var/dir/to/script /var/etc/etc/etc/" > /etc/crontab
3)or put the contents of this into a file, then do "file > /etc/crontab"

这篇关于不带crontab -e的Crontab的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆