[OLUG] help with cron/user services
Vincent
vraffensberger at home.com
Thu May 11 03:07:22 UTC 2000
puzzled wrote:
>
> How would you set up a generalized cron job? The script would have to get a list of users from
> somewhere (by scanning /home/* directories for a .pagerc?) and then reading the details from each
> config file?
>
> I'd like to hear if anyone else has done something like this ....
>
> -------------------------------------------------------------------------
If I understand this correctly, you merely need to add a crontab entry for a
user via a script. I'd do it like this...
#!/bin/sh
#this may be flawed, but it should get you
#started in the right direction at least
ls /home/ | grep -v ftp | grep -v httpd
#do some loop below to get all users
/usr/bin/crontab -u $1 -l > /home/$1/.crontab
echo "00,15,30,45 * * * * perl -w /your/script > /dev/null 2>&1" >>
/home/$1/.crontab
/bin/chown $1:0/home/$1/.crontab
/bin/chmod 600 /home/$1/.crontab
/usr/bin/crontab -u $1 /home/${USER1}/.crontab
-------------------------------------------------------------------------
Sent by OLUG Mailing list Manager, run by ezmlm. http://olug.bstc.net/
To unsubscribe: `echo unsubsribe | mail olug-unsubscribe at bstc.net`
More information about the OLUG
mailing list