Rsync problem versions out of sync


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Rsync problem versions out of sync
# 1  
Old 05-24-2013
Rsync problem versions out of sync

Hello,

I have a report which I am writing as a .tex file, and I am editing from two computers (office and home laptop). I use rsync over ssh connection to synchronise between them and all the rssync commands are written in a Shell script.

Code:
#synchronise from office computer to home laptop
rsync -auzv user@host://pathtoremote directory/   /pathtolocaldirectory

#and vice versa
rsync -auzv /pathtolocaldirectory user@host://pathtoremote directory/

I run this code, in a shell script, after finishing some part of the work at either machine.
Now, it turns out that I have edited some portion in my laptop yesterday night, and forgotten to do this synchronisation. and came to work today, and edited the same tex file. I realised the mistake , when the generated pdf showed some old content.

Now , I am stuck. If I go home and run this synchronising commnd, it will overwrite the changes I made in my laptop . Basically I have two versions of the same file.

Is there any way, automatically you can use some shell scripting to see which portions were modified in the laptop, and merge the two versions together,. I know that diff command works to find the difference between two files, but is there some better way to do it, I dont understand very clearly the output of diff, but can rsync help in this ?

I should have used some DropBox which automatically syncs, but anyways, how do I solve this ?
# 2  
Old 05-24-2013
This is a little messier than you might hope. You can created what is called an ed script using diff, then run ed against the script. This is usually called merging files.

The reason I suggest this approach is that latex is more like a PDL than text


Howto:
Comparing and Merging Files
# 3  
Old 06-20-2013
Diff and manual comparison copy paste

Thanks all for your suggestions. I ran diff command and found with the output, which lines differ. Then I manually copy pasted the changes from one file to the other, and ran diff again .

Maybe there was a simpler solution , but this is what I found most useful.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Rsync from remote machine via ssh and sync by uisng find by modified time

Hi I have a requirement to rsync from remote to local machine via ssh and sync files that are changed in last n hours. pgrep to check if no other sync is running pgrep -f rsync.*/opt > /dev/null || rsync --bwlimit=10000 -avz --delete root@X.X.X.X:/var/source/ /opt/dest/ >> /home/log 2>&1... (0 Replies)
Discussion started by: robo
0 Replies

2. UNIX for Dummies Questions & Answers

Having a problem with the time sync from Solaris 10 to VirtualBox

I have a VirtualBox w2008r2 Domain Controller running on a Solaris 10 server. I have the time on the Virtual machine set to Default time sync (bios clock) and the Solaris server set to sync to 0 8,20 * * * /usr/sbin/ntpdate tick.usno.navy.mil tock.usno.navy.mil >> /tmp/ntp.log My problem is... (2 Replies)
Discussion started by: SIFT3R
2 Replies

3. Solaris

How to sync without rsync?

rsync for solaris seems to be a spotty beast. It's not installed by default. I facing a problem where I didn't have root access to be able install rsync. I did have ssh access and was able to configure the authorized keys so that no password was required to connect from one server to another. ... (1 Reply)
Discussion started by: abe123
1 Replies

4. Shell Programming and Scripting

rsync - transactional sync with multiple nodes

Hi Everyone, We have a requirement to sync files with multiple nodes. We need to run the rsync sequentially on each node, if one of the node fails we need to recover the files to previous state in all nodes. I know that we have backup option in rsync which takes the backup of files before... (0 Replies)
Discussion started by: MVEERA
0 Replies

5. Red Hat

NTP sync problem

Hi, I have 4 machines and all are NTP configured with same ntp.conf file. But 3 machines are in sync with Time server and 4th machine is not contacting & sync with the NTP server. Please see the below details. # service ntpd stop Stopping ntpd: ... (0 Replies)
Discussion started by: uday123
0 Replies

6. Shell Programming and Scripting

problem with rsync

Hi, I am copying files from one server to the other by rsync utilty. I am giving a list file to the rsync and i am writing it to the log also. The problem is that,rsync is not copying the order in which i have given files and links to the list. I can see it, through the log file. I am giving... (7 Replies)
Discussion started by: vvenu88
7 Replies

7. Shell Programming and Scripting

Compatibility problem of Tk Module in different versions

Hi, I am using Tk module in perl 5.6 and it is working fine. Now when i installed the newer version 5.10.0 then getting error that Tk module not found. But i will have to work on this newer verison only to use some other modules of perl. I want to know why Tk module is not working in newer... (6 Replies)
Discussion started by: kunal_dixit
6 Replies

8. Solaris

Sync to Green vs. Separate Sync

Hi all....I have a Sun Ultra2 that I want to use with my PC monitor. I have purchased an adapter that does not work and I was told I need to change my video card setting (if I can) to Separate Sync.....my Monitor product number ends in 1343......I am running SunOS 5.7 ......anyone have any ideas? ... (0 Replies)
Discussion started by: psantinello
0 Replies

9. UNIX for Advanced & Expert Users

primary-secondary sync problem

hi guys, i am new to this DNS business and i'm having a problem. the setup is bind 9.2.3 is installed on a sun solaris 8 server and is the primary DNS. men and mice suite is installed on another sun solaris 8 and that is our secondary DNS server. problem is recently the secondary DNS stopped... (0 Replies)
Discussion started by: mbannout
0 Replies

10. UNIX for Dummies Questions & Answers

rsync problem

Hi, I wanna synchronize all the /etc settings from my previous server to new one. (Both of them are Debian Etch 4.0) I used this command: rsync -r -vz -e ssh someuser@myOldServer:/etc /etc & rsync -avz -e ssh someuser@myOldServer:/etc /etc These commands told me that everything occur perfectly... (6 Replies)
Discussion started by: mjdousti
6 Replies
Login or Register to Ask a Question