In centos7 crontab regularly plans tasks every 5 minutes

  • 2020-10-31 22:05:53
  • OfStack

1. Input command:


[root@master ~]# crontab -e

Add: 2.


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

3. Waiting for verification:


[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 years  08 month  02 day   week 4 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 --- 

conclusion


Related articles: