File Compare & Move between 2 servers


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting File Compare & Move between 2 servers
# 1  
Old 11-29-2005
File Compare & Move between 2 servers

Greetings -

I am a newbie in shell scripts. I have been thru the whole forum but there has been no similar query posed.

The objective of my system is to have a unified filebase system. I am using RSync to synchronise files between the location & central server with both of them having the same folder structure. The flow of RSync being from location server to central server. Now while I am running RSync I need to find the files that have been deleted in the location server, identify those files in the central server and then move those files to "To be deleted" folder in the central server.

Can anyone out here help me with the scripts for the same?

Thanking in anticipation.

Regards,
Aishwarya
This User Gave Thanks to evolve For This Post:
# 2  
Old 11-30-2005
Here is a query that is very similar to yours, except that the files are directly being deleted instead of being moved to any "to be deleted" directory.

For more, search the forums. Go to advanced search, search by keyword and select "search entire posts". You may find what you are looking for.
# 3  
Old 11-30-2005
Data but...

--delete option in RSync means it will delete from the destination and this is something i cannot afford for i need to move those files to separate folder as i need to preserve them for manual intervention.

Is there any other way out? PLs help...

Rgds,
Aishwarya
# 4  
Old 11-30-2005
I have never used rsync, but here's something that you could try:
If the -n (--dry-run) option also shows the files that would get deleted with the --delete option, then use that to find which file would get deleted and then run ssh to make a copy of those files on the remote end to whatever directory that you want. Then run rsync with the --delete but without the --dry-run to actually delete the files.

Again, I must reiterate that I have never used rsync, so I might be totally off target here.
# 5  
Old 11-30-2005
thanks

wl try the options u have suggested and revert back.

thanks, ash
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Help with file compare and move script

I'm running debian (the raspbian version of it) and working on a script to compare files in 2 directories, source and target, move files with duplicate names to a 3rd directory, then move remaining files in source to target. I can't get the syntax right, keep getting syntax errors and can't get... (7 Replies)
Discussion started by: mattz40
7 Replies

2. Shell Programming and Scripting

File Move & Sort by Name - Kick out Bad File Names & More

I have a dilemma, we have users who are copying files to "directory 1." These images have file names which include the year it was taken. I need to put together a script to do the following: Examine the file naming convention, ensuring it's the proper format (e.g. test-1983_filename-123.tif)... (8 Replies)
Discussion started by: Nvizn
8 Replies

3. Shell Programming and Scripting

Script to overwrite & before that keep copy a file on many servers

I have ssh password less auth enable & script does the job well as well #/bin/bash for i in `cat ip` do scp /etc/resolv.conf root@$ip done But I need to take backup of the file i will overwrite .. is there any simple way ? Kindly respond (5 Replies)
Discussion started by: heman96
5 Replies

4. Shell Programming and Scripting

Compare File & Copy Replace if Successful

Hi All, I have written a shell script that creates a backup of my MySQL database. The script performs the following functions: Creates a Backup of the MySQL database Compresses the Backup Copies the Backup to a Remote Server Send an E-Mail displaying the size of the Backup Removes any... (6 Replies)
Discussion started by: SalientAnimal
6 Replies

5. Shell Programming and Scripting

Archive & move the file

I have a set of files in path /ifx01/etldata/lmt/ a.xml b.xml I have to archive & move these files to path /ifx01/etldata/archive ,so that not even the original files should exists. After acrhiving there should be no files in path /ifx01/etldata/lmt/ (6 Replies)
Discussion started by: jagadeeshn04
6 Replies

6. Shell Programming and Scripting

Compare two files A & B and accordingly modify file A

Friends, i have two huge complex files (for eg :A & B)as output , the sample contents of the files are as follows : A == ID,DATE,SUM1,SUM2,TOTAL(SUM1+2) A5066,20/04/2010,25000,50000,75000 A5049,20/04/2010,25000,60000,85000 B == ID,DATE,SUM1,SUM2,TOTAL(SUM1+2)... (2 Replies)
Discussion started by: appu2176
2 Replies

7. UNIX for Dummies Questions & Answers

How to compare 2 files & get specific value & replace it in other file.

Hiiii Friends I have 2 files with huge data. I want to compare this 2 files & if they hav same set of vales in specific rows & columns i need to get that value from one file & replace it in other. For example: I have few set data of both files here: a.dat: PDE-W 2009 12 16 5 29 11.11 ... (10 Replies)
Discussion started by: reva
10 Replies

8. Shell Programming and Scripting

Compare two file & output

Hi every body i have a problem need help urgently file 1 (approx 200K entries) aaaaa bbbb cccccc dddd ffff file 2 (approx 2 million entries) aaaaa,1,ee,44,5t,6y, bbbb,3,ff,66,5u,8r, cccccc, ..... dddd, ..... eeeeee, ..... ffff, ...... (5 Replies)
Discussion started by: The_Archer
5 Replies

9. Shell Programming and Scripting

Compare & replace contents within a file

I have 2 files file1 1 TMQUEUE QUE1 STMW633A 100 DMADM DOMGRPSTMW633A STMW633A 100 GWADM GWTGRPSTMW633A STMW633A 100 GWADM GWTGRPSTMW633AA STMW633A 100 GWADM GWTGRPSTMW638A STMW638A 100 TMSYSEVT EVTGRPSTMW633A STMW633A 100 TMSYSEVT ... (2 Replies)
Discussion started by: kaustubh137
2 Replies

10. Shell Programming and Scripting

Need a sheel script to compare no of file on diffrent servers

i have serverA and serverB and i have a folder with same name an location in both servers.... Now i want to compare files in folder(serverA) with folder (serverB) if there are files missing in folderB then copy those files from folder(serverA) to folder(serverB) (1 Reply)
Discussion started by: ashahzad
1 Replies
Login or Register to Ask a Question