creating shell script with passing command line arguments
by ramsforums from LinuxQuestions.org on (#5P3V3)
I have a remote server in which I have come education data.
I want to compare those files with local directories.
Assume my IP Address is 168.aaa.bbb.ccc
I am login as root
for copying I typically use this command line
rsync --protect-args -av root@168.aaa.bbb.ccc:/root/dl/2021\ Academy\ Registered/ /home/mervick/Downloads/dl/2021_Academy_Registered
For comparing, I found the following line of code will do that task
rsync -avun --delete ${TARGET}/ ${SOURCE} | sed -ne 's/^deleting *//p'
Now I want to create a shell script cmpdir.sh to compare two command line directories using following below command.
rsync -avun --delete ${TARGET}/ ${SOURCE} | sed -ne 's/^deleting *//p'
For example I will issue the following command
./cmpdir root@168.aaa.bbb.ccc:/root/dl/2021\ Academy\ Registered/ /home/mervick/Downloads/dl/2021_Academy_Registered
How do I implement the script?
Thanks
I want to compare those files with local directories.
Assume my IP Address is 168.aaa.bbb.ccc
I am login as root
for copying I typically use this command line
rsync --protect-args -av root@168.aaa.bbb.ccc:/root/dl/2021\ Academy\ Registered/ /home/mervick/Downloads/dl/2021_Academy_Registered
For comparing, I found the following line of code will do that task
rsync -avun --delete ${TARGET}/ ${SOURCE} | sed -ne 's/^deleting *//p'
Now I want to create a shell script cmpdir.sh to compare two command line directories using following below command.
rsync -avun --delete ${TARGET}/ ${SOURCE} | sed -ne 's/^deleting *//p'
For example I will issue the following command
./cmpdir root@168.aaa.bbb.ccc:/root/dl/2021\ Academy\ Registered/ /home/mervick/Downloads/dl/2021_Academy_Registered
How do I implement the script?
Thanks