Hi
I am trying to automate an operation of copying files of specific user to another server using a simple script.
The problem is I dont know how to pass a parameter which is a username to the remote command. Please look into the script below and help me out in sorting this out
Code:
#! /bin/bash
echo "Enter the username: "
read user
rsync --progress -avz -e ssh root@server1:/local/home/$user/local/home/;//copy files from remote server
ssh root@server1 'du -sh /hsphere/local/home/$1'; // checking the actual file size"this is where My question arouse"
du -sh /hsphere/local/home/$1 //checking the file size transferred.
Will this work?
~