Umavmishra
asked on
Please explain this scp command
Can anybody please decode this for me
scp -r -i /user/home/xceldt/.ssh/id_ fdt-test kstsrv5:/user/home/data/ar c*$archive date*/*.ta r.gz temp
scp -r -i /user/home/xceldt/.ssh/id_
... let's assume $archivedate contains "2009-05-05"
scp will copy from kstsrv all files which match "*.tar.gz" from the directory or directories matching "/usr/home/data/arc*2009-0 5-05*/"
The asterisks surrounding $archivedate and the asterisks contained in the filename make scp copy e.g.
/usr/home/arcABC2009-05-05DEF/UVW.tar.gz or
/usr/home/arcGHI2009-05-05JKL/XYZ.tar.gz
Replace the bold strings above with any actually existing directory/file on that host.
scp will copy from kstsrv all files which match "*.tar.gz" from the directory or directories matching "/usr/home/data/arc*2009-0
The asterisks surrounding $archivedate and the asterisks contained in the filename make scp copy e.g.
/usr/home/arcABC2009-05-05DEF/UVW.tar.gz or
/usr/home/arcGHI2009-05-05JKL/XYZ.tar.gz
Replace the bold strings above with any actually existing directory/file on that host.
ASKER
Thanks woolmilkporc
ASKER
can you please tell me how do i give the acess details in the identity file?
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
Thanks a lot!
-r tells scp to recursively copy entire directories.
-i tells scp which identity file (the file from which the identity (private key) for RSA authentication is read) to use.
kstsrv is the remote host
: is the deimiter between hostname and the following -
/user/home/data/arc*$archi
temp is the local destination directory
wmp