[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cobalt-users] [cobalt-user][Qube 2] Crontab Sample File! run-parts won't run as root.



Your crontab is fine.
Some notes here though.
The file that you posted should go in /etc/crontab
and be run as your system crontab and not as a users cron.
So before you panic check /etc/crontab
(Make sure you are logged in a root 1st)
If its not there it may exist somewhere else on a RaQ2 (I dont have on but I dont think it would be anywere else)
The file you were looking at /var/spool/cron/admin
is the admin user's contab so thats a no go.

For /etc/crontab make sure its owned by root and in the root group.
Make sure it has the proper privs (should be chmod 644)

Though it should be owned by root and not admin.

Something else of note...
your cron deamon should not be running as admin either but as root.

And finally the /etc/crontab directory listing should look like
-rw-r--r--    1 root     root          657 Oct 27 11:49 /etc/crontab
Obviously the size, date and time will vary.

Hope this helps.

-Thomas

At 09:52 AM 10/30/2003, you wrote:
Anyone, please post an working example of your crontab owned by admin.
What need to see is how to get the admin's cron jobs to run with root
permission.

#
# Additional Details
#
I have messed up the /var/spool/cron/admin file on my Qube 2
and don't have a backup to restore. opps.
First I got the error
/bin/bash: root: command not found
for every cron job that ran. At that time the crontab file looked like this

# Begin Admin's crontab file
#

SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root

# Run any at jobs every minute
* * * * * root [ -x /usr/sbin/atrun ] && /usr/sbin/atrun

# run-parts
03,18,33,48 * * * * root run-parts /etc/cron.quarter-hourly
04,34 * * * * root run-parts /etc/cron.half-hourly
01 * * * * root run-parts /etc/cron.hourly
05 0,6,12,18 * * * root run-parts /etc/cron.quarter-daily
02 1 * * * root run-parts /etc/cron.daily
02 2 * * 0 root run-parts /etc/cron.weekly
02 3 1 * * root run-parts /etc/cron.monthly

# Remove /tmp, /var/tmp files not accessed in 10 days (240 hours)
41 02 * * * root /usr/sbin/tmpwatch 24 /tmp /home/tmp /var/tmp
/var/cobalt/tmp

# Remove formatted man pages not accessed in 10 days
39 02 * * * root /usr/sbin/tmpwatch 240 /var/catman/cat?

# Monitor services to make sure everything is still okay.
0,15,30,45 * * * * root /usr/local/sbin/monitor

#
# End Admin's Crontab File

I read in the archives that someone else removed the "root" in front of the
run-parts
command. I tried that and now I get the following error.
Error:
Cannot write process cache: Permission denied at /usr/local/sbin/monitor
line 122, <PS> chunk 1.

So the process needs root permissions to run correctly. HOW dow I get
runparts to run with root permission


_____________________________________
cobalt-users mailing list
cobalt-users@xxxxxxxxxxxxxxx
To subscribe/unsubscribe, or to SEARCH THE ARCHIVES, go to:
http://list.cobalt.com/mailman/listinfo/cobalt-users