Reason analysis and solution of crontab timing task not executed

  • 2020-12-20 03:57:32
  • OfStack

preface

Linux timing tasks include :cron, anacron, at, etc. cron is the name of the service, crond is the background process, and crontab is a customized schedule of tasks

Today, however, it took crontab so long to realize that it also needed to be started

Timing task added but not working well


[root@dev-gl-lh1 ApiAgent]# cat /etc/crontab 
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/

# For details see man 4 crontabs

# Example of job definition:
# .---------------- minute (0 - 59)
# | .------------- hour (0 - 23)
# | | .---------- day of month (1 - 31)
# | | | .------- month (1 - 12) OR jan,feb,mar,apr ...
# | | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
# | | | | |
# * * * * * user-name command to be executed

#  The cache coin  Mapping data 
*/5 * * * * root /usr/bin/php /data/application/SwooleMoney/script/bin/cli.php CacheData cacheCoinMap

#  Cache the transaction pair information 
*/1 * * * * root /usr/bin/php /data/application/SwooleMoney/script/bin/cli.php CacheData cacheSymbol

#  Delete depth data 
*/1 * * * * root /usr/bin/php /data/application/SwooleMoney/script/bin/cli.php CacheData clearExchangeDepths >/tmp/clearExchangeDepths.log
~          
~  

The script executes once per minute but doesn't wait for the log until all the flowers are gone


#  To view crontab  state 
[root@dev-gl-lh1 ApiAgent]# /etc/init.d/crond status 
crond dead but pid file exists
#  Start the crontab  service 
[root@dev-gl-lh1 ApiAgent]# /etc/init.d/crond start
Starting crond: 

The log has output the script to successfully execute, increase the knowledge.

Reference address: https: / / www ofstack. com article / 154290. htm

conclusion


Related articles: