Maybe someone can explain this ...
I have taken a full backup of a server using find . -print -depth | cpio -ocB > /dev/rmt/0
I can do a full restore using cpio -icvdumB -I /dev/rmt/0
Let's say I only want to restore /home/user1/* and /home/user2/*
1st way to do this is to say cpio -icvdumB -I /dev/rmt/0 "/home/user1/*" "/home/user2/*"
This works fine.
Now, lets say I have a script to do the restore ...
This doesn't work, and I reckon it's because of the syntax which cpio requires when specifying patterns to restore. So I try this ...
Now, I would expect this to work, because when using set -x to run the script, the command is exactly the same as the 1st one I used above from the command line. However, this doesn't work :-( Aaaaaargh!
The *only* way I have achieved what I want, is to put a list of all the directories I want to restore in a control file (1 directory per line) and doing
cpio -icvdumB -I /dev/rmt/0 -E /path/to/control/file
This works a treat
Now, this isn't a problem but I was wondering if anyone can explain why what should work doesn't! In practive I'll want to restore a lot more than 2 user directories.
BTW, all this is done on Solaris, but will be implemented on SCO - should there be any difference, given cpio is "native"?
Greg.
I have taken a full backup of a server using find . -print -depth | cpio -ocB > /dev/rmt/0
I can do a full restore using cpio -icvdumB -I /dev/rmt/0
Let's say I only want to restore /home/user1/* and /home/user2/*
1st way to do this is to say cpio -icvdumB -I /dev/rmt/0 "/home/user1/*" "/home/user2/*"
This works fine.
Now, lets say I have a script to do the restore ...
Code:
#!/bin/ksh
RES_LIST="/home/user1/* /home/user2/*"
cpio -icvdumB -I /dev/rmt/0 ${RES_LIST}
Code:
#!/bin/ksh
RES_LIST="\"/home/user1/*\" \"/home/user2/*\""
cpio -icvdumB -I /dev/rmt/0 ${RES_LIST}
The *only* way I have achieved what I want, is to put a list of all the directories I want to restore in a control file (1 directory per line) and doing
cpio -icvdumB -I /dev/rmt/0 -E /path/to/control/file
This works a treat
Now, this isn't a problem but I was wondering if anyone can explain why what should work doesn't! In practive I'll want to restore a lot more than 2 user directories.
BTW, all this is done on Solaris, but will be implemented on SCO - should there be any difference, given cpio is "native"?
Greg.