LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 04-22-2013, 10:48 AM   #1
Predatorian
Member
 
Registered: Mar 2008
Location: currently, where ever the army takes me
Distribution: Debian Lenny/Ubuntu or Arch Linux
Posts: 145

Rep: Reputation: 28
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
 
Old 04-22-2013, 01:07 PM   #2
custangro
Senior Member
 
Registered: Nov 2006
Location: California
Distribution: Fedora , CentOS , RHEL
Posts: 1,979
Blog Entries: 1

Rep: Reputation: 209Reputation: 209Reputation: 209
What operating system are you running? If running a Red Hat derivative; check your SELinux contexts
 
Old 04-22-2013, 01:08 PM   #3
Predatorian
Member
 
Registered: Mar 2008
Location: currently, where ever the army takes me
Distribution: Debian Lenny/Ubuntu or Arch Linux
Posts: 145

Original Poster
Rep: Reputation: 28
I am running RHEL 6
 
Old 04-22-2013, 01:49 PM   #4
custangro
Senior Member
 
Registered: Nov 2006
Location: California
Distribution: Fedora , CentOS , RHEL
Posts: 1,979
Blog Entries: 1

Rep: Reputation: 209Reputation: 209Reputation: 209
Quote:
Originally Posted by Predatorian View Post
I am running RHEL 6
Is SELinux running?

What's the output of

Code:
getenforce
 
Old 04-22-2013, 08:57 PM   #5
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,362

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
Could well be SELinux; what errors/msgs (exactly) are you getting.
Have you checked /var/log/audit/audit.log?
 
Old 04-23-2013, 08:16 AM   #6
Predatorian
Member
 
Registered: Mar 2008
Location: currently, where ever the army takes me
Distribution: Debian Lenny/Ubuntu or Arch Linux
Posts: 145

Original Poster
Rep: Reputation: 28
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
problem in adding attachment in crontab kalpesh chhajed Linux - Newbie 3 11-25-2011 04:51 AM
Adding Custom Process to snmpd.config prabakar4all Linux - Server 0 08-01-2011 01:57 PM
adding custom dialog to wxWidgets GordonAkst Linux - Software 0 09-16-2010 06:57 PM
bad minute error adding a crontab job htamayo Linux - Newbie 7 03-15-2010 08:56 AM
adding a job to crontab via shell script tazio Linux - General 7 10-23-2003 02:44 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 07:58 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration