1834645 Members
2514 Online
110069 Solutions
New Discussion

cron problems - Round 2

 
SOLVED
Go to solution
Bill Brutzman
Frequent Advisor

cron problems - Round 2

This morning, the rights of many [perhaps all] of our files were whacked. The files were found to have less rights than desired. I suspect a bad cron daemon is at work. I need help tracking it down.

crontab -l is per the attachment.

From the other thread...I restored the original cron file from tape. Thus, this is the original cron problem.

3 REPLIES 3
Kevin Wright
Honored Contributor

Re: cron problems - Round 2

Not exactly sure what your asking..if perms have been changed, and you think it was from cron, check all the cron scripts for chmod.
Darrell Allen
Honored Contributor
Solution

Re: cron problems - Round 2

Hi Bill,

Do any of the /u2/crons jobs change permissions on files? A common problem is for a script to cd to a directory that doesn't exist. If you don't verify the cd command actually worked then you will get unexpected results from your chmod (or worse, rm).

Another case is when using a variable as the argument to a cd command. If the variable was null then you would be cd'ing to the home dir. Again, you need to verify you actually cd'ed to the dir you meant to.

Also is a good reason for changing root's home dir to /root.

Darrell
"What, Me Worry?" - Alfred E. Neuman (Mad Magazine)
James R. Ferguson
Acclaimed Contributor

Re: cron problems - Round 2

Hi Bill:

Darrell's point is very well taken!

To that end, this is often convenient:

# cd /mydir && (echo good!;date;echo good!)

If the cd is successful, you execute the commands in the list, otherwise you don't!

Regards!

...JRF...