crontab执行定时任务

在linux下面使用命令crontab -e  编辑任务;

[adv@localhost]$ crontab -e

之后开始编辑任务

* * * * * cd /home/adv/work/cutter_log/ && bash ./cutlog_minute.sh >> ./log/run.log 2>&1

以上命令的意思是每分钟切换到cutter_log目录下执行cutlog_minute.sh脚本,并将脚本输出的内容存到目录log下的run.log文件

之后执行crontab -l 可以查看当前用户下的crontab任务

[adv@localhost cutter_log]$ crontab -l
#clk and act log cutter
* * * * * cd /home/adv/work/cutter_log/ && bash ./cutlog_minute.sh >> ./log/run.log 2>&1

posted @ 2017-09-05 17:12  JahanGu  阅读(242)  评论(0编辑  收藏  举报