Copying specific files from remote m/c to specific folders


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Copying specific files from remote m/c to specific folders
# 1  
Old 06-12-2008
Copying specific files from remote m/c to specific folders

Hi All,
I am trying to rsync some of the latest files from remote m/c to my local linux box.
Folder structure in my remote m/c looks like this

Code:
/pub/Nightly/Package/ROLL/WIN
/pub/Nightly/Package/SOLL/sol
/pub/Nightly/Package/SOLL/linux

Each of the folder contains gzip files which on daily basis get updated so I am trying to get only latest or new file from these three folders

I want to sync files for all three platform in one single folder like this, my target folder should look like this:

Code:
/drive/back/Win
/drive/back/sol
/drive/back/linux

I am able to do for one platfrom but how to do it for 2 other platfrom,

situation is like this that you don't know for which platform you will get file first so need to check for all platforms in single shot and get the file from that platform to correct location.
Suppose in morning linux folder get updated first that you should be able to get file from /pub/Nightly/Package/SOLL/linux to /drive/back/linux

And this what my shell script looks like:
mirror.sh
--------
LOCAL_PATH=/drive/back/linux
LIST_OF_FILES=`find /pub/Nightly/Package/SOLL/linux -type f -daystart -mtime 0 | grep "OWL"`

for ONE_FILE in ${LIST_OF_WIN_FILES}
do
rsync --verbose --recursive --delete --times \
${ONE_FILE} \
${LOCAL_PATH} \
done

Can anyone help me out in this situation.
I will be thankful to you

Last edited by Yogesh Sawant; 06-13-2008 at 05:50 AM.. Reason: added code tags
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Copying specific file types to specific folders

I am trying to write a script that cycles through a folder containing many folders and when inside each one it's supposed to copy all the .fna.gz files to a folder elsewhere if the file and the respective folder have the same name. for fldr in /home/playground/genomes/* ; do find .... (8 Replies)
Discussion started by: Mr_Keystrokes
8 Replies

2. UNIX for Advanced & Expert Users

Find files in specific folders

Hi Team, I am new to the linux commands and I really need help . I would be really thankful if I can get some inputs. I have below folders in the path "/home/temp" 20170428 20170427 20170429 changes tempI need to get the files generated in the last 15 mins in all the above folders... (4 Replies)
Discussion started by: JackJinu
4 Replies

3. Shell Programming and Scripting

Bash to move specific files from folders in find file

I have a directory /home/cmccabe/nfs/exportedReports that contains multiple folders in it. The find writes the name of each folder to out.txt. A new directory is then created in a new location /home/cmccabe/Desktop/NGS/API, named with the date. What I am trying to do, unsuccessfully at the moment,... (7 Replies)
Discussion started by: cmccabe
7 Replies

4. Shell Programming and Scripting

How to delete all the files and folders inside all the directories except some specific directory?

hi, i have a requirement to delete all the files from all the directories except some specific directories like archive and log. for example: there are following directories such as A B C D Archive E Log F which contains some sub directories and files. The requirement is to delete all the... (7 Replies)
Discussion started by: Little
7 Replies

5. Shell Programming and Scripting

Bash to download specific files and save in two folders

I am trying to download all files from a user authentication, password protected https site, with a particular extension (.bam). The files are ~20GB each and I am not sure if the below is the best way to do it. I am also not sure how to direct the downloaded files to a folder as well as external... (7 Replies)
Discussion started by: cmccabe
7 Replies

6. Shell Programming and Scripting

Copying files with a specific pattern

Hi All I am trying to copy files from one location to another and given below are some sample ones: aaa_bbb_ccc_ddd_cost_code_20140330.gz aaa_bbb_ccc_ddd_revenue_zone_20140329.gz aaa_bbb_ccc_ddd_benefit_extract_20140330.csv.gz aaa_bbb_ccc_ddd_profit_zone_20150509.csv.gz... (17 Replies)
Discussion started by: swasid
17 Replies

7. Shell Programming and Scripting

Copying specific files from one dir to another

Hi Folks, I have one curious case. There are list of following files placed in one directory such as... And updated each month. files.JAN09.csv files.FEB09.csv files.MAR09.csv ..... Now, I need to move a specific files; i.e, For this month, I need to move only OCT09, NOV09, DEC09,... (1 Reply)
Discussion started by: Jerald Nathan
1 Replies

8. UNIX for Dummies Questions & Answers

Monitoring specific files and folders

I want a mechanism to monitor a folder full of files that are sensitive. I want to log all accesses,modifications and changes to any file within the folder in a log file which should give me access/modify/change times,the user id of the process which tried and the pid. Even some idea of what to... (1 Reply)
Discussion started by: Vivek788
1 Replies

9. Shell Programming and Scripting

decompressed files to specific folders

Hi all, I have a script below which meant to decompress *.tr.gz to allocated folder. e.g. hello.tar.gz should be decompress to a subdirectory called hello and all the files should be in hello subdirectory. How do i do it? Am i missing anything? Condition: there are existing tar.gz in teh... (3 Replies)
Discussion started by: c00kie88
3 Replies

10. UNIX for Dummies Questions & Answers

Copying specific files

I wanted to see if some one could confirm the proper command and format for copying specific files i.e., ones that contain certain character string in the file name. I would like to copy all files that contain a numeric sequence in the file name i.e., "922371". Files are compressed - *.gz. Would... (3 Replies)
Discussion started by: faaron3
3 Replies
Login or Register to Ask a Question