CRON - not executing jobs in new directories

General support questions
Post Reply
z.petersen1
Posts: 10
Joined: 2017/11/21 06:58:19

CRON - not executing jobs in new directories

Post by z.petersen1 » 2017/12/04 09:00:25

Hi there,

I'm a little bit confused, because my CRON doesnt work as I wish :?:

I've created 2 additional directories:
/etc/cron.one-minute
/etc/cron.five-minute

in /etc/crontab it looks like this:
SHELL=/bin/sh
#SHELL=/bin/bash (I tried this out too...)
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

# m h dom mon dow user command
#* * * * * root /bin/date > /tmp/date.output
#*/1 * * * * root /bin/date > /tmp/date1.output
*/1 * * * * root cd / && run-parts --report /etc/cron.one-minute
*/5 * * * * root cd / && run-parts --report /etc/cron.five-minute
17 * * * * root cd / && run-parts --report /etc/cron.hourly
25 6 * * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )
47 6 * * 7 root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly )
52 6 1 * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly )

but in the both directories there will no script be executed.
in the "cron.hourly" directory all is fine...

when I execute the scripts "by hand" in the both directories it works.

I've added a very simple script:
########## Script in directory#############
[root@blobbm cron.one-minute]# ll
total 4
-rwxr-xr-x 1 root root 39 Dec 4 09:40 testcrontab
########## Script #############
[root@blobbm cron.one-minute]# cat testcrontab
#!/bin/bash
date > /tmp/date_crontab
####################################

This line in /etc/crontab is working:
-------------------------------------------
*/1 * * * * root /bin/date > /tmp/date1.output

In UBUNTU it works without problems...

Google dont help until yet :-(
Maybe here is someone who has a good idea?

regards
-zocki-

z.petersen1
Posts: 10
Joined: 2017/11/21 06:58:19

Re: CRON - not executing jobs in new directories

Post by z.petersen1 » 2017/12/04 09:12:08

ups, I tried now the following, changing the syntax to a simpler one:

*/1 * * * * root run-parts /etc/cron.one-minute

then it worked...
Why?

Post Reply