AnotherAlan
Technical User
A little tester, I can't work out why it does this;
I have a script that reads file partitions to ufsdump from a flat file. When I added another partiton to dump it fails to pick it up. If I change the loop to a for loop it works!
original: Works with one item in flat file. Doesn't work with two items or more in flat file.
cat /admin/backup/servername_backup_list | while read BACKUP_ITEM2
do
echo "---Starting UFSDUMP of servername:$BACKUP_ITEM2 at `date`" >> $logfile 2>&1
rsh servername "/usr/sbin/ufsdump 0fu backupserver:$TAPE $BACKUP_ITEM2" >> $logfile 2>&1
echo " " >> $logfile 2>&1
done
This works:
for part in `cat /admin/backup/servername_backup_list`; do
rsh servername "/usr/sbin/ufsdump 0fu backupserver:$TAPE $part" >> $logfile 2>&1
done
And for the UUOC police I could do this; but it doesn't work either.
while read part; do
rsh servername "/usr/sbin/ufsdump 0fu backupserver:$TAPE $part" >> $logfile 2>&1
done < /admin/backup/servername_backup_list
I'm confused, but guessing it must be to do with rsh somehow.
All help appreciated.
Alan
I have a script that reads file partitions to ufsdump from a flat file. When I added another partiton to dump it fails to pick it up. If I change the loop to a for loop it works!
original: Works with one item in flat file. Doesn't work with two items or more in flat file.
cat /admin/backup/servername_backup_list | while read BACKUP_ITEM2
do
echo "---Starting UFSDUMP of servername:$BACKUP_ITEM2 at `date`" >> $logfile 2>&1
rsh servername "/usr/sbin/ufsdump 0fu backupserver:$TAPE $BACKUP_ITEM2" >> $logfile 2>&1
echo " " >> $logfile 2>&1
done
This works:
for part in `cat /admin/backup/servername_backup_list`; do
rsh servername "/usr/sbin/ufsdump 0fu backupserver:$TAPE $part" >> $logfile 2>&1
done
And for the UUOC police I could do this; but it doesn't work either.
while read part; do
rsh servername "/usr/sbin/ufsdump 0fu backupserver:$TAPE $part" >> $logfile 2>&1
done < /admin/backup/servername_backup_list
I'm confused, but guessing it must be to do with rsh somehow.
All help appreciated.
Alan