jkays@ab.msc.umn.edu (Jeffrey Kays) (12/13/90)
Problem at hand:
I am trying to dump my root partition to another disk partition
via cron. I execute a shell script that runs the command:
dump 0f - / | (cd /mnt; restore xf -)
This command works fine when I do it from the shell. But when it
runs from cron, I get this output:
open("/dev/tty"): No such device or address
DUMP: Date of this level 0 dump: Wed Nov 21 08:19:05 1990
DUMP: Date of last level 0 dump: the epoch
DUMP: Dumping /dev/rrz2a (/) to standard output
DUMP: Mapping (Pass I) [regular files]
DUMP: Mapping (Pass II) [directories]
DUMP: Estimated 9127936 bytes output to Standard Output
DUMP: Dumping (Pass III) [directories]
DUMP: Child 3278 returns LOB status 15
DUMP: Bad return code from dump: 0
What DEC tells me is that I can't do this because dump and restore
want to open /dev/tty, and since this is running from cron, there
is no associated terminal. But I know it's not dump, because I'm
using it in other places to dump out partitions to tape. And if I
do something like this from my script:
dump 0f /tmp/root.dump /
cd /mnt
restore xf /tmp/root.dump
it works. So why can't I use dump and restore in a pipe??
I'm running Ultrix 3.1 (Worksystem V2.1) on a DECstation 3100.
Any ideas would be *greatly* appreciated!!
jeff
--
Jeff Kays E-Mail: jkays@msc.edu
Minnesota Supercomputer Center Phone: (612) 626-1824
Minneapolis, Minnesota Fax: (612) 624-6550
"May fortune favor the foolish"avolio@decuac.DEC.COM (Frederick M. Avolio) (12/14/90)
Well, sometimes what Digital tells you might not really be totally accurate. Iknow this is shocking to many of you... :-) We do this with a shell script. Crontab entry looks like: 0 18 * * * /var/adm/manager/rootbkup the shell script is basically (I took out all the nice problem checks, mounting, etc. for this example): dump 0uf - / | (cd /bck ; restore xf -) >/dev/console Now... I only made it a shell script to add the mounts, unmounts, logging, etc. The trick is to send your output to the console, then /dev/tty means something. Fred