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

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



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