From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <97958003614020.tru64-unix-managers.marc@archive.invalid> From: Ron Bramblett Date: Mon, 15 Jan 2001 17:35:02 +0000 To: tru64-unix-managers Subject: Summary: Defragcron Errors X-MARC-Message: https://marc.info/?l=tru64-unix-managers&m=97958003614020 Thanks to everyone who replied. I was abit confused and if I would have understood the man page better I would not have asked the question. My Original Questions: > I have an AlphaServer 2000 running Tru64 Unix 4.0e with the following > line in the the crontab. We are running Tru64 Unix version 4.0F on an AlphaServer 4100. > > 31 02 * * 6 test -x /usr/sbin/defragcron && /usr/sbin/defragcron -p -v > >>/usr/adm/defragcron.log 2>&1 > > Does anyone know what the 149 error in a defragcron log is. > How do I make the logs read what time it was logged.. > Right now all I have is an entry like this: > > defragment -T 149 dom0 > defragment -T 149 dom1 > > defragment -T 149 dmn3 > defragment: Defragmenting domain 'dmn3' > defragment: Defragmenting domain 'dom1' > defragment: Defragmenting domain 'dom0' > defragment: Defragmented domain 'dom0' > defragment: Defragmented domain 'dom1' > defragment: Defragmented domain 'dmn3' > > How do I know if it passed or if it failed. And when it was ran. I received answers from Sean O'Connell, Bryan Lavelle, John P Speno, Peter.Stern, kat, Steve Butcher, Chris Ruhnke and John Verier. Most of the common answer was read the man pages. I did that but since it was in a log file I was confused. I also got responses that said this is normal and it is assumed that the defragcron completed. John Verier sent a scipt that will allow the defragment to take place and still be logged. here it is ---------------------------------------------------------------------- #! /bin/csh -f set status_file = "/var/tmp/defrag.status" set admin_user = "sysadmin" set dt = `date` echo " "$dt[1]" "$dt[2]" "$dt[3]", "$dt[6] >>! $status_file echo "Defrag STARTed at "$dt[4]" "$dt[5] >>! $status_file /usr/sbin/defragcron -p -a 06:30 >>! $status_file set dt = `date` if ($status != 0) then echo "At end of defrag,"$dt[4]" "$dt[5]", status was "$status >>! $status_file /bin/cat $status_file >>! /usr/adm/defragcron.log /usr/ucb/mail -r "Odin Defrag Failed" $admin_user < $status_file /bin/cp /dev/null $status_file exit 1 endif echo "Defrag FINISHed at "$dt[4]" "$dt[5] >>! $status_file echo " " >>! $status_file /bin/cat $status_file >>! /usr/adm/defragcron.log /usr/bin/mailx -s "Odin Defrag Succeeded" $admin_user < $status_file /bin/cp /dev/null $status_file exit 0 ---------------------------------------------------------------------- Also if you want time stamps you could try this If you want timestamps, I'd switch the crontab entry to send its ouput to /usr/bin/logger, i.e. 31 02 * * 6 test -x /usr/sbin/defragcron && /usr/sbin/defragcron -p -v 2>&1 | /usr/bin/logger -p local0.info -t defragcron -- Ron Bramblett Systems Adminstrator Fuller Brush Company