Sponsored Content
Top Forums UNIX for Dummies Questions & Answers How to copy files from remote server to local? Post 302834985 by parpaa on Sunday 21st of July 2013 06:19:40 AM
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..
 

10 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

4. 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

5. 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

6. 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

7. 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

8. 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

9. 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

10. 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
rpload(1)						      General Commands Manual							 rpload(1)

NAME
rpload - alpine remote data utility SYNTAX
rpload [ -f ] [ -s trimSize ] -t Type -l Local_file -r Remote_folder DESCRIPTION
Rpload may be used to convert local Alpine configuration files or address books into remote configurations or address books. It is intended to be used by system administrators. Regular users should normally use the facilities provided within Alpine. Local_file will usually be a user's alpine configuration file, and Remote_folder is the IMAP folder which will be used (with the help of Alpine's -p, -P, and -x commands or PINECONF, PINERC, and PINERCEX environment variables) as the user's remote configuration folder. A copy of Local_file will be placed in the folder with the correct header lines to satisfy Alpine. -f Force the load even if the remote folder is in the wrong format. This will delete the contents of the folder so use it carefully. -s trimSize If the number of messages in the remote folder is more than one plus trimsize (one is for the header message), then messages 2, 3, and so on will be deleted until there are only one plus trimsize messages left. If this option is not set no trimming will be done. -t Type The possible Types are pinerc, abook, and sig. (Sig is mostly obsolete. Literal signatures contained within the remote pinerc should be used instead.) -l Local_file The file on this system that is to be copied. -r Remote_folder A remote folder name to be copied to. See the Alpine documentation for the syntax of a remote folder name. One exam- ple is {my.imap.server}remote_pinerc. DIAGNOSTICS
Exit status is zero if all goes well, -1 otherwise. SEE ALSO
Rpdump(1). Copyright 1989-2007 by the University of Washington. $Date: 2005/01/14 20:40:14 $ rpload(1)
All times are GMT -4. The time now is 02:27 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy