1825750 Members
2360 Online
109687 Solutions
New Discussion

Root Equivalent Cron job

 
SOLVED
Go to solution
Nick D'Angelo
Super Advisor

Root Equivalent Cron job

Hello.

Due to root's cron job list getting to big and confusing, I wanted to split some of the entries. For example, many of the entries are for batch processing of our application and/or database tasks, these I want to move to another id called batch that will require the equivalent of root.

I have created a userid for batch and all the other administration for the user.

How do I set this up?

Suggestions?

Always learning
3 REPLIES 3
James R. Ferguson
Acclaimed Contributor
Solution

Re: Root Equivalent Cron job

Hi Nick:

It's good practice to run only those tasks that need to be run as root under root.

By "equivalent of root", I hope you are not intending to replicate UID=0 for your other account(s). This is a DANGEROUS practice that should be avoided.

I assume (no comments, please) that your "batch" accounts are "normal" users. Therefore, make sure to declare them appropriately in cron's 'allow' and/or 'deny' files (/var/adm/cron.allow & /var/adm/cron.deny) as necessary.

See 'man crontab' for details.

...JRF...
Paula J Frazer-Campbell
Honored Contributor

Re: Root Equivalent Cron job

Hi
I agree with James that it is bad and dangerous practice to create extra UID=0.

Do you identify your jobs in the crontab ?

A small example of my crontab:-

########################################################
# Do not ammend without clearing with SYSADMIN first #
########################################################
# Mirror backup to N-0/avroTWO dir
00 10 * * * /sysadmin/mirrorbackup > /dev/null 2>&1
00 12 * * * /sysadmin/mirrorbackup > /dev/null 2>&1
00 14 * * * /sysadmin/mirrorbackup > /dev/null 2>&1
00 16 * * * /sysadmin/mirrorbackup > /dev/null 2>&1
00 18 * * * /sysadmin/mirrorbackup > /dev/null 2>&1
00 20 * * * /sysadmin/mirrorbackup > /dev/null 2>&1
50 20 * * * /sysadmin/k1copy > /dev/null 2>&1
########################################################
# Passwd hosts netconf etc copy
30 23 * * * /sysadmin/k1-k2
########################################################
# Cemis update
00 01 * * * /universe/DOWNLOADS/cemis.update
########################################################
# Remove core dumps
00 06 * * * /sysadmin/core_clean
########################################################
# Check disk space
00 05 * * * /sysadmin/spacecheck

If you seperate and flag what is going on it is by far easier to maintain.

HTH

Paula
If you can spell SysAdmin then you is one - anon
Nick D'Angelo
Super Advisor

Re: Root Equivalent Cron job

Hmm, maybe I didn't ask correctly. Here is part of my crontab file.

On second thought, I think you have pointed me in the right direction.

The database activities that are currently called up by Root's cron can probably be moved to batch's cron.(after some testing of course)

Therefore, root equivalent batch is not required at all.

Thank you to both of you for your replies and frankness. You gotta love this forum.

Nickd

(Unix wannabe I guess)
Always learning