DWQA QuestionsCategory: ServerLinux timed task not executed
baochunfen asked 2 weeks ago

A timing task is written as follows:
Linux timed task not executed
You want to automatically execute this command at the 30th minute of every hour, but it doesn’t work.
Use PS aXu | grep cron to check that the cron process is started, but in hibernation, as shown in the figure:
Linux timed task not executed
Linux uses Ubuntu 18.04
Linux timed task not executed
I’m very confused, beginner of Xiaobai. How can I help you?

fefe replied 2 weeks ago

Check the log of crontab

1 Answers
Best Answer
Liu Yun bin answered 2 weeks ago

There is a problem with the above command, which is not supported by crontab&>>, should use>>and2>&1, as follows:

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

crontabDefaultshellyesshshI won’t support it&>>, if you want to usebash, can be setSHELL=/bin/bash, if the answer is useful, please accept the answer and like.