Cron jobs running as something other than root

Cron jobs running as something other than root

Post by phi » Sat, 08 Sep 1990 15:00:09

># If you are running BSD or flavors of System V you have available to you
># the 'crontab' command. Just create a crontab file for the USER you wish
># to run cron jobs for. Then su to the username you wish to install it for
># and say "crontab < your_cron_file". That's all folks.

>Not quite.  BSD through 4.3-reno doesn't have this.  4.4 will have it,
>in the form of my free version of cron (which uses crontab -uUSER rather
>than 'su USER;crontab' btw).  Grab it from anon ftp
>/pub/misc/vixie/cron2.tar.Z.  (Will appear in comp.sources.unix shortly.)

You can also run an 'at' job, go to /usr/spool/cron/atjobs (or where ever
your system puts such things) and copy your at job script off somewhere.  Be
sure to note the permissions on the file.

Now you have the basis for any command(s) you want to run from cron by
any user.  I often hack such scripts to get database engines to run
reports for me from cron.  But many applications that do not require
operator input will run this way.  Your environment is set in the script
that 'at' created, so most anything is possible.

| Phil Meyer  email: uunet!vitec!phil   Home: (214) 6254130                   |


1. Cron jobs running as something other than root

In our /etc/crontab there are entries that are run for uucp.

Here are some examples:

30 * * * * su uucpa < /usr/var/uucp/uucp.hour
0 6 * * * su uucpa < /usr/var/uucp/
0 12 * * * su uucpa < /usr/var/uucp/uucp.noon
0 3 1 * * su uucpa < /usr/var/uucp/uucp.week
0 2 * * * su uucpa < /usr/var/uucp/uucp.night
#30 2 1 * * su uucp < /usr/var/uucp/uucp.longhall

"uucpa" is an admin. id for uucp.

hope this helps,


Academic Computer Center                or      gatech!dekalb!douglas
DeKalb College
555 N. Indian Creek Drive/Clarkston, Ga. 30021  (404) 299-4233

2. Solaris Express (Solaris 10 snapshots) for SunBlade 2500?

3. cron did not run root jobs (solaris 2.5.1)

4. Basic Backups

5. Root fails to run cron job

6. Isolate a single number with others like it on multiple lines.

7. Environment for jobs run out of root cron

8. Settings in /etc/systems

9. Cron <root@host> run-parts /etc/cron.daily

10. Postinstallation - Cron <root@main> run-parts --report /etc/cron.daily

11. Cron <root@host> run-parts /etc/cron.weekly

12. Cron <root@cxXXXXX-a> run-parts /etc/cron.daily

13. What's this: Cron <root@hindustan> run-parts /etc/cron.daily