How to copy files from remote server to local?


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers How to copy files from remote server to local?
# 1  
Old 07-21-2013
How to copy files from remote server to local?

Hi experts,

I 'm newbie to unix world, now I have task to copy the latest files from remote server to my local. I believe this must be very common request in this community. I want you do it one more time for me please.
My requirement is something like this:

I receive files in the below format

ABC_XCompany_report_201205.txt
XXY_XCompany_report_201206.txt
DEF_XCompany_report_201207.txt

Now I need to copy the latest file to my local. I receive these files on monthly basis. So I need to create new folder before copying these files. The name of these new folder should be from the time stamp of the file, we receive them.

I'd tried with below script- but with little success!Smilie
Code:
option batch continue
option confirm off
open mysession

lcd c:\destination_folder
get /archive/data/folder1/*report*.txt|tail -1 |xargs -i c:\destination_folder\

close
exit

Hope this makes sense.
Thank you so much for taking time!

Last edited by parpaa; 07-21-2013 at 07:56 AM..
# 2  
Old 07-21-2013
Do the folloiwng
sftp-->get

Definitions as below :
SFTP Secure file transfer program.
get[flag][local path]
# 3  
Old 07-21-2013
How to copy files from remote server to local?

I am not sure if you have understood my complete requirement here?
# 4  
Old 07-21-2013
Quote:
Originally Posted by parpaa
. . . I believe this must be very common request in this community. I want you do it one more time for me please . . .
You are right, it has been discussed umpteen times. Why don't you take the time, search theses forums, and adapt the solutions found? We're glad to help with problems, then.

Quote:
I am not sure if you have understood my complete requirement here?
I'm not sure you have understood the forum rules?
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Copy local files to single remote host but multiple folders using rsync

I'm trying to copy a file myfile.scr from my local Linux server to multiple folders on remote AiX server using single rsync command. Below command helps me copy the file "myfile.scr" from my localhost to a remote host folder "/app/deployment/tmpfiles" rsync --delay-updates -F --compress... (1 Reply)
Discussion started by: mohtashims
1 Replies

2. Solaris

Script to get files from remote server to local server through sftp without prompting for password

Hi, I am trying to automate the process of fetching files from remote server to local server through sftp. I have the username and password for the remote solaris server. But I need to give password manually everytime i run the script. Can anyone help me in automating the script such that it... (3 Replies)
Discussion started by: ssk250
3 Replies

3. UNIX for Dummies Questions & Answers

Copy files from Linux server local windows machine using a shell script

Hello, I need to create a shell script which will copy files - which are created on particular date and starting with particular name - to local windows XP machine. Is this possible.? Currently it is being done manually using winscp (1 Reply)
Discussion started by: NarayanaPrakash
1 Replies

4. UNIX for Dummies Questions & Answers

compare zip files from a local to remote server

Good evening I need your help pease I know there are 2 commands(diff, or cp) to compare files in a directory. but the question arises: 1. can i compare zip files or ive got to unzip them? 2. how can i compare 2 files from a local to a remote server? (is there any special commad or ive got... (4 Replies)
Discussion started by: alexcol
4 Replies

5. UNIX for Dummies Questions & Answers

Copy files from remote server

Hi Friends, Could you please help me as per my requirement mentioned below ? I have to copy files from one unix server to another unix server, and the files that i need to copy from the remote server are only those which are modified/created Today from abc directory on the remote server (1 Reply)
Discussion started by: ramask
1 Replies

6. Shell Programming and Scripting

copy files from remote server (B) to target server (A)?

Hi All, what is the comand to log off the remote server? I have 2 servers A, B. I need to find all files older than 7 days on server B and copy over to server A. My logic is: login the remote server: ================= ssh hostB cd /data/test find . -mtime -7 -ls | awk '{print... (4 Replies)
Discussion started by: Beginer0705
4 Replies

7. UNIX for Advanced & Expert Users

Commands to copy a tar.gz file from a Remote Unix Server to Local Desktop.

Hi, Just wanted to know, how can I ftp/transfer/copy a (design.tar.gz) archive from a Unix Server (sdmc222.sdmc.cp-srv.com) which is at a remote location, to my Windows Desktop. Obviously, it is not possible at cmd prompt on my Windows using the following commands :- ftp... (3 Replies)
Discussion started by: marconi
3 Replies

8. UNIX for Dummies Questions & Answers

Copying files from a remote server to local system with cygwin

Hi. I'm sorry if I get on people's nerves asking this, but I don't really understand how to do this and unfortunately don't have the time to work through it step by step in books, etc. At University, we have a unix server that hosts our files. we each have a login and password to access it. I... (3 Replies)
Discussion started by: patwa
3 Replies

9. Shell Programming and Scripting

FTP multiple files from remote server to local server

Hi, I am facing a weired problem in my FTP script. I want to transfer multiple files from remote server to local server everyday, using mget * in my script. I also, want to send an email for successful or failed FTP. My script works for file transfer, but it don't send any mail. There is... (2 Replies)
Discussion started by: berlin_germany
2 Replies

10. UNIX for Dummies Questions & Answers

how to copy files from local computer to server

hi, im a newbie using unix. My local computer OS is Windows XP while server is using Unix. May i know how to transfer file from local computer to server? i do not know the commands. Thanks. :) (3 Replies)
Discussion started by: sagolo
3 Replies
Login or Register to Ask a Question