LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 08-01-2007, 01:58 AM   #1
synapse
Member
 
Registered: Jan 2004
Location: On Planet Earth.
Distribution: Slackware 12
Posts: 244

Rep: Reputation: 30
How do I syncronise 2 directories


Hi

Ok having a laptop and a desktop usually results in different info under the a users directories.

I woluld like to have the same info on either machine.

Ie if a user logs in on the laptop and creates files etc, somehow at the end of the day the same files will be copied over to the desktop machine at some time. And vice versa , if a user logs on to the desktop and creates files , evetnually the files will be replicated to the laptop.

How do I do this.

Obviously I can copy and paste the whole user directory but this will have problems. ie what if new files exist on both machines at the time of copy then the new files on the destination machine will get replaced.

Any Ideas

Thanx
 
Old 08-01-2007, 02:15 AM   #2
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
Commonly used tools for that are rsync and unison.
 
Old 08-01-2007, 02:58 AM   #3
synapse
Member
 
Registered: Jan 2004
Location: On Planet Earth.
Distribution: Slackware 12
Posts: 244

Original Poster
Rep: Reputation: 30
Hi

thanx will look into the man pages for this.

will rsync sync both ways or wil i hav to run rsync from each machine at a different time ?
 
Old 08-02-2007, 01:13 AM   #4
ppoisson
LQ Newbie
 
Registered: Mar 2006
Location: Lille, France
Distribution: slackware 10.2
Posts: 3

Rep: Reputation: 0
Why don't you use NFS?
It'll solve your home directory replication problems.
 
Old 08-02-2007, 02:27 AM   #5
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
If you mean sharing a single repository between both machines, it would only marginally help.
A laptop, by design, is mobile so it can't be constantly connected to a network.
 
Old 08-02-2007, 03:53 PM   #6
BCarey
Senior Member
 
Registered: Oct 2005
Location: New Mexico
Distribution: Slackware
Posts: 1,639

Rep: Reputation: Disabled
Quote:
Originally Posted by synapse
Hi

thanx will look into the man pages for this.

will rsync sync both ways or wil i hav to run rsync from each machine at a different time ?
I think you need to rsync both ways, but you can run the script from one machine. I don't know about unison.

Brian Carey
 
Old 08-02-2007, 04:13 PM   #7
Franklin
Senior Member
 
Registered: Oct 2002
Distribution: Slackware
Posts: 1,348

Rep: Reputation: 217Reputation: 217Reputation: 217
If you use KDE, you might want to look into the krusader file manager {http://www.kde-apps.org/content/show.php?content=10214}.
It has a nice sync utility that is fairly intuitive to set up.
You can find the build script at http://www.slackbuilds.org/repositor...stem/krusader/.
 
Old 08-02-2007, 05:58 PM   #8
rg3
Member
 
Registered: Jul 2007
Distribution: Fedora
Posts: 527

Rep: Reputation: Disabled
Disclaimer: I haven't used unison, so I don't know if it solves the following problem.

What the OP asked is quite hard to automate without using NFS (or something similar) as it has already been suggested. The problem are deleted files. If a file is in one drive but not in the other, is that because the file has been removed in one end or because it has been added in the other end? Granted, you could ommit the --delete option in rsync, but that way you would be unable to delete any files. So you probably want the --delete option. If you don't carefully sync always before using one computer or after having used it, you could (a) make an old file appear (which shouldn't be very important) or (b) make a new file disappear. The second case is problematic, so you need to run rsync manually and carefully to avoid those mistakes.
 
Old 08-03-2007, 09:03 AM   #9
synapse
Member
 
Registered: Jan 2004
Location: On Planet Earth.
Distribution: Slackware 12
Posts: 244

Original Poster
Rep: Reputation: 30
Hi

Just managed to get back here, Thanx for the valued info. Ill go with the rsync option but as rg3 says its going to get a little confusing, quite a problem though cause one minute you are using the laptop , the next you are using the desktop and vice versa. Maybe just create 1 directory that gets synced one way only. mmmm

Well thanx anyways
 
Old 08-03-2007, 10:02 AM   #10
BCarey
Senior Member
 
Registered: Oct 2005
Location: New Mexico
Distribution: Slackware
Posts: 1,639

Rep: Reputation: Disabled
If you really need 2-way, unison seems a better choice.

Brian
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Copying files and sub-directories of a directory except the directories named ".abc" sri1025 Linux - General 2 08-24-2010 08:53 AM
Moving directories to new directories keysorsoze Linux - Newbie 2 03-31-2006 07:14 PM
CHMOD directories.sub-directories.files zerojosh Linux - Software 2 11-19-2005 03:22 PM
Searching multiple directories and sub directories for a file jeep99899 Linux - Newbie 2 10-13-2005 12:23 PM
Directories LinguelSanchez Linux - Newbie 3 07-03-2003 02:20 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 05:41 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration