File Transfer
Hi,
I'm new to unix, and creating a script to transfer files. I am able to do so using scp. Issue is I want to transfer files from a directory located at different unix server and to a directory located at another unix server. Can any one please help me? Thanks in advance! |
That's a bit of a short qn, but as per docs http://linux.die.net/man/1/scp
Code:
scp user1@host1:/dir1/file1 user2@host2:/dir2/file2 |
Thanks Chris!
Command you specified above is working fine. But my script is demanding something else. I'm trying to find all the files in a directory of another server, using below command: find server:/path/ -type f After getting the result i will need to place few more filter then i would need to transfer filtered files at a location. But find cmd prompts with an error: find: stat() error server:/path/: No such file or directory. |
'find' only takes a dir as the search path.
The easiest way to do what you want (assuming I understand requirement), is to login to box1 and do your filtering there, saving file list into a file list (sic), then Code:
for filename in `cat files.lst` That should get you started. You may need these links http://linux.die.net/man/ http://tldp.org/LDP/Bash-Beginners-G...tml/index.html http://www.tldp.org/LDP/abs/html/ Note also that you'll need any reqd dirs to already exist on the target. |
I am not very clear about what you are asking.
Please correct me if I am wrong You are trying to filter some files inside one directory and then copy those files from that particular server to another server? If this is what you are trying to do then you can simply move all those filtered files into any directory and then copy it to your client machine Code:
#find / -type f exec cp {} /files/ \; then Code:
#scp -rvf /files/* 192.168.0.XX:/path/to/dir/ Code:
#rsync -avh /files/* 192.168.0.XX:/path/to/dir Code:
#rsync -avh -delete /files/* 192.168.0.XX:/path/to/dir |
All times are GMT -5. The time now is 06:13 AM. |