kagxin / blog

个人博客:技术、随笔、生活
https://github.com/kagxin/blog/issues
7 stars 0 forks source link

crontab 的使用 #18

Open kagxin opened 5 years ago

kagxin commented 5 years ago

1、设置环境变量,声明使用的编辑器

EDITOR=vim; export EDITOR

2、编写一个corn文件 ,examplecron

# (put your own initials here)echo the date to the console every
# 15minutes between 6pm and 6am
0,15,30,45 18-06 * * * /bin/echo 'date' > /dev/console

3、加载corn文件

$ crontab examplecron

4、查看加载过的配置

$ crontab -l
0,15,30,45 18-06 * * * /bin/echo `date` > dev/tty1

ref: https://linuxtools-rst.readthedocs.io/zh_CN/latest/tool/crontab.html

kagxin commented 5 years ago

ubuntu crontab 在 /var/log/目录下没有cron.log 文件

ref: https://www.cnblogs.com/yuanqiangfei/p/8058324.html

kagxin commented 5 years ago