DWQA QuestionsCategory: ServerLinux timing task not executed
baochunfen asked 3 weeks ago

Write a timer task as follows:
Linux timing task not executed
I want to execute this command automatically every 30 minutes, but it doesn’t work.
With ps axu | grep cron, I checked that the process of cron was started, but in hibernation, as shown in the figure below:
Linux timing task not executed
Linux USES ubantu18.04
Linux timing task not executed
It is confused very much, small white introductory, consult everybody elder brother how to solve?

fefe replied 3 weeks ago

Check the crontab log..

1 Answers
Best Answer
Liu Yunbin answered 3 weeks ago

There is a problem with the command above, crontab is not supported&>>, should be used>>and2>&1, the details are as follows:

30 * * * * ls /home/baochunfen >> /home/baochunfen/crontab.txt 2>&1
Liu Yunbin replied 3 weeks ago

crontabUsed by defaultshellisshshDoes not support&>>, if neededbash, you can setSHELL=/bin/bashIf the answer is useful, please accept the answer and thumb up.