网站运营
位置:首页>> 网站运营>> centos7中crontab定时计划任务5分钟一次命令写法

centos7中crontab定时计划任务5分钟一次命令写法

作者:吴跟强  发布时间:2023-11-02 23:21:16 

标签:centos7,计划任务,crontab,定时

1.输入命令:


[root@master ~]# crontab -e

2.添加:


*/5 * * * * /usr/share/nginx/spark_run_nginx_log.sh 2&>1 >> /usr/share/nginx/crontab_spark_run_nginx.log

3.等待验证:


[root@master ~]# cd /usr/share/nginx/
[root@master nginx]# ls
crontab_spark_run_nginx.log metastore_db run_log.sh
derby.log          modules    spark_run_nginx_log.sh
html             nginx_log.py test_log_records_add.sh
[root@master nginx]# cat crontab_spark_run_nginx.log
18年 08月 02日 星期四 11:25:01 CST job start...
--- rm hdfs output_nginx ---
--- rm url information ---
Deleted /user/flume/nginx_log_output_need/url/20180802
--- rm url information ok---
--- rm ip404 information ---
Deleted /user/flume/nginx_log_output_need/ip404/20180802
--- rm ip404 information ok---
--- rm hdfs output_nginx Done ---
--- spark-submit ---

总结

以上所述是小编给大家介绍的centos7中crontab定时计划任务5分钟一次命令写法,希望对大家有所帮助.

来源:https://blog.csdn.net/wugenqiang/article/details/81355633

0
投稿

猜你喜欢

手机版 网站运营 asp之家 www.aspxhome.com