Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VIO Backups

Status
Not open for further replies.

kjsys1

MIS
Jan 14, 2003
14
US
I am trying to create a create to backup all our VIO servers from one central server (our NIM). I'm using the supported method by running an ssh command to the HMC to run the mount (mounts nfs filesystem to VIO server) and then a backupios command to execurte the backup. This is all in a loop which reads a file that has all our VIO servers listed. The problem I'm encountering is that it does the 1st VIO backup correctly but never loops back to read the rest of the file. I know the syntax of the do while is correct because if I comment out the ssh commands and just echo out the server name I see that it loops thru just fine. There is something about the ssh/viosvrcmd statements that throws it out of the loop.
Anyone have any ideas?

Thanx,
Ken
 
Let me guess, sth like this:

Code:
cat /path/to/listfile|while read viohostname
do
 ssh padmin@${viohostname} backupios command script
done

trouble is: ssh "uses up" all available stdin data

so use -n flag to redirect stdin from /dev/null

Code:
cat /path/to/listfile|while read viohostname
do
 ssh -n padmin@${viohostname} backupios command script
done

or redirect stdin in your script:

Code:
cat /path/to/file|while read viohostname
do
 ssh padmin@${viohostname} backupios command script </dev/null
done

Last solution is to use a for loop

Code:
for viohostname in $(</path/to/listfile}
do
 ssh padmin@${viohostname} backupios command script
done

See man ssh for more details.


HTH,

p5wizard
 
Hello

here what I am doing.
From the vio server there is a script running on the crontab padmin:
- Set up the profile
- Mount nfs to the nim server
- Run the backup
example:
Vhost=`hostname -s`
. /home/padmin/.profile
mount $NIM_SVR:/backup /backup
# Make backup VIO
backupios -file /backup/backupios.${Vhost} -nosvg -mksysb
unmount /backup

You should add some test to be sure your backup complete well
It is working perfectly and I have been able to test also the restore from the backup done successfully.

Cheers
Al.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top