LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Adding a custom directory to /etc/crontab (https://www.linuxquestions.org/questions/linux-server-73/adding-a-custom-directory-to-etc-crontab-4175459139/)

Predatorian 04-22-2013 10:48 AM

Adding a custom directory to /etc/crontab
 
Howdy LQ,

I am having issues running scripts within a custom directory I added to /etc/crontab
I added same arguments, and gave the same permissions to the custom directory as what the other cron directories have. Is there something that I am missing? Or am I going to have to edit the 'crontab -e', and redo all of this on my 80 different nodes?

Code:

cat /etc/crontab
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/

# run-parts
01 * * * * root run-parts /etc/cron.hourly
02 4 * * * root run-parts /etc/cron.daily
22 4 * * 0 root run-parts /etc/cron.weekly
42 4 1 * * root run-parts /etc/cron.monthly
05 * * * * root run-parts /etc/cron.cleanup

Code:

drwxr-xr-x  2 root root    4096 Apr 22 09:54 cron.cleanup
drwx------  2 root root    4096 Jul 15  2008 cron.d
drwxr-xr-x  2 root root    4096 Jun  1  2009 cron.daily
-rw-r--r--  1 root root      0 Jun  1  2009 cron.deny
drwxr-xr-x  2 root root    4096 Jul 14  2006 cron.hourly
drwxr-xr-x  2 root root    4096 Jun  1  2009 cron.monthly
drwxr-xr-x  2 root root    4096 Jun  1  2009 cron.weekly

Code:

-rwxr-xr-x 1 root root 144 Apr 22 09:47 guardian_coredump.sh

custangro 04-22-2013 01:07 PM

What operating system are you running? If running a Red Hat derivative; check your SELinux contexts

Predatorian 04-22-2013 01:08 PM

I am running RHEL 6

custangro 04-22-2013 01:49 PM

Quote:

Originally Posted by Predatorian (Post 4936646)
I am running RHEL 6

Is SELinux running?

What's the output of

Code:

getenforce

chrism01 04-22-2013 08:57 PM

Could well be SELinux; what errors/msgs (exactly) are you getting.
Have you checked /var/log/audit/audit.log?

Predatorian 04-23-2013 08:16 AM

The answer to my question is:

instead of
Code:

05 * * * * root run-parts /etc/cron.cleanup
it is supposed to be
Code:

*/5 * * * * root run-parts /etc/cron.cleanup

Now it runs every five minutes, outputs to /var/log/cron and does what I need it to do. Thanks for help guys.


All times are GMT -5. The time now is 12:57 PM.