Hello Everyone, I am having a very odd thing happening I can't recall I have ever had this happen. I need to copy data from one Linux server to another from several different mount points. (i.e /0c, /0d, /0e). I wanted to set up a bash script to copy a fresh copy each day and run the script off hours. below is the script the script is being run on the destination server. I did a pwd and echo just to verify I was in the correct directory and running the correct command for testing. When the script runs it only copies the /root directory contents to each mount point and not the data that's actually in the mount points but, if I run the command manually on the destination server from the command line everything works fine. To run the command manually on the destination server I cd to the mount point on the server the and run the command " ssh ussaif08 'find /0c | cpio -o' | cpio -idmv > /dev/null 2>&1 ". Any help would be greatly appreciated thanks in advance.
for sMntPt in `cat /root/TstDataMntPts.txt`
do
cd $sMntPt
pwd
echo "Cmd to run ssh ussaif08 'find $sMntPt | cpio -o' | cpio -idmv > /dev/null 2>&1"
ssh ussaif08 'find $sMntPt | cpio -o' | cpio -idmv > /dev/null 2>&1
done
for sMntPt in `cat /root/TstDataMntPts.txt`
do
cd $sMntPt
pwd
echo "Cmd to run ssh ussaif08 'find $sMntPt | cpio -o' | cpio -idmv > /dev/null 2>&1"
ssh ussaif08 'find $sMntPt | cpio -o' | cpio -idmv > /dev/null 2>&1
done