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

Re: Anacron-Script für User (Was: brauche ich die Dateien in /var/log/ksymoops ? = 167MB!)



Hallo Jörg,

On Fri, 18 Jul 2003 14:30:19 +0200
Jörg Schütter <joerg@schuetter.org> wrote:

> ich habe das mit folgendem Script gelöst (/usr/local/bin/anacron4user):
> --- cut ---
> #!/bin/bash
> 
> fullpath=`dirname $0`
> cron_x=`basename $fullpath`
> 
> userid=`grep "^users:" /etc/group | cut -d ":" -f 3`
> users=`grep "^[-a-z0-9_][-a-z0-9_]*:x:[0-9][0-9]*:$userid:" /etc/passwd \
> 	   | cut -d ":" -f 1`
> 
> for user in $users;
> do
> 	userpath=`grep "^$user:" /etc/passwd | cut -d ":" -f 6`
> 	if [ -d $userpath/$cron_x ]; then
> 		/bin/su - $user "/usr/bin/nice \
> 			/bin/run-parts --report $userpath/$cron_x" \
> 		2>&1 | mailx -s "anacron: $cron_x for $user" $user@localhost
> 	fi
> done
> --- cut ---
> 
> In jedem Verzeichnis /etc/cron.??* liegt dann nur noch ein Symlink auf
> /usr/local/bin/anacron4user

Ooops, noch was vergessen. Die ausführbaren Dateien liegen dann in
$HOME/cron.??*


Gruß
  Jörg

-- 
Jörg Schütter           http://www.lug-untermain.de/
                        http://www.schuetter.org/joerg/
joerg@schuetter.org     http://mypenguin.bei.t-online.de/



Reply to: