Crontab only executes the first line

I am trying to configure multiple cron jobs on a VPS under centos / whm. I added the following lines to / var / spool / cron / root:

*/5 * * * * find /some-dir/* \( ! -iname ".ht*" \) -delete */10 * * * * find /some-other-dir/* \( ! -iname ".ht*" \) -delete 

but only the first line is executed (for / some-dir /). If I exchange the lines - / some-other-dir / execute, / some-dir / - no. I tried to put semicolons at the end of each line, put spaces, tabs, change the file encoding - nothing.

How can I get cron to handle both tasks?

here is the output of / var / log / cron:

 Sep 18 11:05:01 host crond[3302]: (root) CMD (find /some-dir/* \( ! -iname ".ht*" \) -delete) Sep 18 11:10:01 host crond[3303]: (root) RELOAD (/var/spool/cron/root) 

thanks!

+4
source share
1 answer

It seems that cron requires an empty string and the end of crontab. I accidentally left such a line and viola! both tasks are completed.

+4
source

Source: https://habr.com/ru/post/1434879/


All Articles