home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.next.sysadmin
- Path: sparky!uunet!caen!zaphod.mps.ohio-state.edu!magnus.acs.ohio-state.edu!shviid
- From: shviid@magnus.acs.ohio-state.edu (Steen H Hviid)
- Subject: problem using 'dump' from cron
- Message-ID: <1992Nov10.161836.22028@magnus.acs.ohio-state.edu>
- Sender: news@magnus.acs.ohio-state.edu
- Nntp-Posting-Host: top.magnus.acs.ohio-state.edu
- Organization: The Ohio State University
- Distribution: usa
- Date: Tue, 10 Nov 1992 16:18:36 GMT
- Lines: 48
-
- Hi Everybody,
-
- I have a problem, my script works absolutely fine when run interactively, and
- even in the background using nohup, but it fails when run by cron (as root).
-
- It tells me that 'dump' terminated with error code 1.
-
- Also, I wanted to redirect the output from the dump command into a file,
- which I would have the script mail to me if anything went wrong, but it doesn't
- like that either. If I redirect standard output, nothing appears there, if I
- redirect error output, it complains about ambiguos redirection.
- I have tried in the crontab entry to redirect the output of the script to both a
- file and null with to no avail.
-
- I am new to the NeXT's so I may overlook something obvious.
- Any suggestions?
-
- Thanks
-
- Steen
- Computer Speclialist
- The Ohio State University
-
-
- # NeXT network server backup
- # Daily unattended backup
- # Steen Hansen, November 1992
-
- LASTLOG="/tmp/backup.last"
- ERRLOG="/tmp/backup.err"
- MAILTO="steen"
-
- date > $LASTLOG
- dump 0fsd /dev/rst0 2750 640000
- code=$?
-
- unload tape
- mt -t /dev/rst0 off
-
- if [ $code != 0 ]
- then
- echo "dump returned error code $code" >> $LASTLOG
- mail -s "NeXT network backup failure" $MAILTO < "$LASTLOG"
- else
- echo 'backup completed' | mail -s 'NeXT backup completed' $MAILTO
- fi
-
-
-