Linked by Thom Holwerda on Mon 17th Apr 2006 21:16 UTC, submitted by anonymous
Linux "If your laptop computer is a complement to your desktop machine, you're probably well aware of the need to synchronize data between the two. When you're in the middle of a big project and know you're going to be spending the afternoon in a doctor's waiting room or on an airplane, it's nice to be able to quickly transfer your project files - and maybe your email and contacts - to the laptop, then vice-versa when you return to your desk. This article will show you two ways to accomplish this on GNU/Linux-based machines."
Order by: Score:
Desktop Laptop?
by mOOzilla on Mon 17th Apr 2006 21:24 UTC
mOOzilla
Member since:
2006-04-11

NAS Shared drive perhaps?

I use SyncToy on Windows with my external drive, It would be nice if this worked in REAL TIME though for every file change.

Reply Score: 0

v Jelly Babies give you the farts..
by mOOzilla on Mon 17th Apr 2006 21:27 UTC
What a strange title
by somebody on Mon 17th Apr 2006 21:41 UTC
somebody
Member since:
2005-07-07

"How to Synchronize Your Desktop and Laptop" ??? spc, rsync ???

What do laptop and desktop have to do with scp and rsync? In case of synchronizing laptop and desktop one would expect some iFolder article not console utilities.

I would understand if article would mention cron job synchronizing of servers not laptop and desktop.

Reply Score: 2

RE: What a strange title
by ma_d on Tue 18th Apr 2006 04:29 UTC in reply to "What a strange title"
ma_d Member since:
2005-06-29

He was talking about people who have project files on their computer... I think they're bright enough to type a command.

Rsync is a great tool to keep your desktop and laptop synchronized. And scp is something I see users use everyday to transfer files.

This concept that you cannot use CLI on a desktop is completely ignorant.. Maybe those who don't wish to learn but point and click their way through life will be content; but I doubt they'll be working on their project files in the doctor's waiting room. For the rest of us, well, we sometimes employ the power of a good text based interface to get work done.

Reply Score: 4

RE: What a strange title
by theine on Mon 17th Apr 2006 22:16 UTC
theine
Member since:
2005-09-29

Yes, this article should rather be called "How to copy files from one machine to another".

Reply Score: 2

Great article and great tools.
by porcel on Mon 17th Apr 2006 22:45 UTC
porcel
Member since:
2006-01-28

Rsync is super easy to use once you understand it and it is the most reliably sync tool I have ever used.

Put this in your .bashrc file:

alias my-sync='rsync -av --delete network/Documents/ /home/joe/Documents/'

The first is your source directory, the second is your target one.

This allows you to sync any two directories easily by typing my-sync at a prompt.

You may think this is hard, but it is the easiest thing to set up and it works all the time, every time. You can even script it so that you don't forget it and anyone can do this.

Please stop thinking so highly of yourselves and demoralizing others with your elitist attitude. Anyone can learn how to use rsync!

Reply Score: 5

RE: Great article and great tools.
by flanque on Tue 18th Apr 2006 03:20 UTC in reply to "Great article and great tools."
flanque Member since:
2005-12-15

Have to agree with you on that. I have found RSYNC to be a fantastic tool for backing up and transfering data. Made my life as a linux server admin much easier. It's reliable, powerful and easy enough to use if you do a bit of reading.

I think I would actually feel rather out-of-control in a GUI after using the command line tools so mucb.

Reply Score: 1

RE: Great article and great tools.
by Kroc on Tue 18th Apr 2006 11:09 UTC in reply to "Great article and great tools."
Kroc Member since:
2005-11-10

Mac OSX has rsync included too. I've been using this script to

1. Create a 128-Bit AES ecrypted password protected volume (if it doesn't exist)
2. mount the volume automatically
3. Sync the source folder into the volume
4. unmount the volume
5. Compact the volume to remove padded space

#BEGIN
VOLUME="$USER""_Backup"
DISKIMAGE="$VOLUME".sparseimage

hdiutil create -encryption -fs HFS+J -type SPARSE -size 60g -volname "$VOLUME" "$DISKIMAGE"

DESTINATION="/Volumes/$VOLUME"
DEVICE=$(hdiutil attach "$DISKIMAGE" | awk "$0~/$VOLUME/ {print $1}")

sudo rsync -E -a -x -S --delete
--exclude-from backup_excludes.txt $*
/source/folder/ $DESTINATION

hdiutil detach "$DEVICE"
hdiutil compact "$DISKIMAGE"
#END

backup_excludes.txt just contains a list of folders/files to ingore.

This works swimmingly except that sudo asks for me to enter my password, is there anyway I can provide my password to sudo in my script so that I can run the script silently?

Reply Score: 2

naelurec Member since:
2006-02-15

You *should* be able to setup your sudoers file to allow that command to run w/o asking for password:

man sudoers
/NOPASSWD

Reply Score: 1

Not elitist
by snowflake on Mon 17th Apr 2006 23:05 UTC
snowflake
Member since:
2005-07-20

It's not a case of it being hard to use rsync, the problem is that it one extra thing to think about out of the one million others things we have to do. It is certainly not a case of being elitist, it is about getting a housekeeping job done with the least amount of effort, and if I can find something to avoid using magical spells on the console I would prefer to use it.

Reply Score: 1

RE: Not elitist
by d a v i d on Tue 18th Apr 2006 04:57 UTC in reply to "Not elitist"
d a v i d Member since:
2005-07-06

One extra thing to think about?

Well, if you have more than one computer, and want to keep all your files synced up on each of them, rsync appears to me to be ONLY ONE thing that you need to remember to accomplish it ;)

I dunno about unison though, will take a look at that

Reply Score: 1

RE[2]: Not elitist
by Gemi on Tue 18th Apr 2006 13:25 UTC in reply to "RE: Not elitist"
Gemi Member since:
2006-04-18

Unison is a bidirectional rsync over a ssh channel, it works pretty good for more than two machines. You just have to choose a ring or star topology.

I have a fairly complex setup: full home dir kept on a central server, synced with desktop, laptop (ppc, iow: the software is portable) and some parts with other servers or even mp3 player. The windows version is slower, and I'd need two copies on the same machine, so I use a samba share or the ext2 driver for windows.

I don't care very much for space, it'd be the perfect piece of software if it could retrieve older versions of previously synced files, but I guess it'd be hard to add such a feature.

Reply Score: 1

RE[3]: Not elitist
by msundman on Tue 18th Apr 2006 14:31 UTC in reply to "RE[2]: Not elitist"
msundman Member since:
2005-07-06

> Unison is a bidirectional rsync over a ssh channel,
> it works pretty good for more than two machines.

Unison barely works for two machines, and using it for more than two machines is worse than awful (although still magnitudes better than rsync, of course).

Unison doesn't handle exclusions well. You can't set it up so that one host only gets certain files in a dir while some other host gets all the files in the same dir. (E.g., I don't want to keep all my photos on my laptops, since they have small HDDs.)

Unison is also very bad at handling conflicts (i.e. the same file has changed on more than one server), with no support for merge-plugins or whatever.

Unison is bad at handling live file systems where files might change or move around while the sync is happening.

Unison's website states: "Unison is resilient to failure. It is careful to leave the replicas and its own private structures in a sensible state at all times, even in case of abnormal termination or communication failures." This is utter BS. I've been forced to rebuild the databases many times due to more or less random crashes.

The GUI as awful! If you want to click a button two times in a row you first have to move the pointer outside the button borders and then back. Absurd! And you can't even multiselect entries in the file list! It's like version 0.0.0.1 or MyVeryFirstGUIProgram or something.

When unison doesn't work it usually crashes without any error messages or anything, it just disappears. When it provides error messages they are completely unhelpful.

Unfortunately I haven't found anything better than unison. (The only alternative I've found, iFolder, seems to require a "master server" to store all files, which I find unacceptable.)

Reply Score: 1

RE[4]: Not elitist
by andrex on Tue 18th Apr 2006 16:44 UTC in reply to "RE[3]: Not elitist"
andrex Member since:
2005-07-06

> Unison barely works for two machines, and using it for
> more than two machines is worse than awful

I'm not sure why you say that. I keep 4 hosts in sync using Unison in a star topology. It's complicated because I need different sets of files synchronized on different hosts, but that's inherent in the problem, it's not Unison's fault.

> Unison doesn't handle exclusions well. You can't set it
> up so that one host only gets certain files in a dir
> while some other host gets all the files in the same
> dir.

Untrue, I do exactly that with Unison. The Fine Manual tells how.

> Unison is also very bad at handling conflicts (i.e.
> the same file has changed on more than one server),

Conflicts inherently require a decision from the user. It can be given manually for each case, or automatically by an overall "always prefer host X" rule. Unison supports both methods.

> with no support for merge-plugins or whatever.

Untrue, I had Unison set up for a while to automatically invoke winmerge for every conflict.

> I've been forced to rebuild the databases many times
> due to more or less random crashes.

I've used Unison for years and have never had to do that.

> The GUI is awful!

You're right about that! I stopped bothering with it years ago.

Reply Score: 1

RE[5]: Not elitist
by msundman on Wed 19th Apr 2006 10:31 UTC in reply to "RE[4]: Not elitist"
msundman Member since:
2005-07-06

> > Unison doesn't handle exclusions well. You can't set it
> > up so that one host only gets certain files in a dir
> > while some other host gets all the files in the same
> > dir.
>
> Untrue, I do exactly that with Unison. The Fine Manual
> tells how.

Not so. Unison "ignores" are:
- based on profiles, not on hosts (e.g. if I want to perform the sync from any host I'll have to have the same ignore list on all hosts and keep them all in sync), which wouldn't actually be so hard if inclusions weren't:
- based solely on paths (e.g. no way to sync "the 1000 newest files")

However, it's better than I've previously realized. Since I've mostly used the GUI version I hadn't previously noticed the "include" profile command which seem to make common ignore lists easier to maintain.


> > with no support for merge-plugins or whatever.
>
> Untrue.

I stand corrected. I have no idea how I hadn't noticed this. As I've mostly used the GUI it might be because it's so bad, but I can't check it right now since the PoS unison-gtk2 refuses to display its main window, just throwing "uncaught exception" and "fatal error" messages at me.


And one other thing that's wrong with unison is that it requires the same version to be available on all hosts. That's insane, considering it's meant to be multi-platform. The current debian stable version is 2.9.1, but that version isn't even available as a win-gtk2 executable! On a debian unstable it's 2.13.16 and on ubuntu breezy it's 2.10.2.

An even remotely sane developer would differ between db/protocol versions (which change less often) and client implementation versions (which change much, much more often), but not the user-ignoring unison developers, no sir!

Reply Score: 1

RE: Not elitist
by Rehdon on Tue 18th Apr 2006 08:07 UTC in reply to "Not elitist"
Rehdon Member since:
2005-07-06

There's a GUI wrapper for rsync: Grsync http://www.opbyte.it/grsync/. I haven't tried it (yet) though, so I can say nothing about its quality.

rehdon

Reply Score: 1

Unison
by andrex on Mon 17th Apr 2006 23:20 UTC
andrex
Member since:
2005-07-06

The author apparently doesn't know about Unison: http://www.cis.upenn.edu/~bcpierce/unison/.

Reply Score: 4

RE: Not elitist
by archiesteel on Tue 18th Apr 2006 00:02 UTC
archiesteel
Member since:
2005-07-02

I almost agreed with you, until you added "to avoid using magical spells on the console"...basically, what you're saying is that you want a GUI front-end. That's fine, but there's no reason to make the console method sound harder than it really is. In fact, one of the advantages of the console method is that it is relatively easy for someone to write scripts and/or a GUI front-end to use it, so that people like you and me who prefer graphical tools can be happy.

This is OSNews, a site for geeks and people who are not afraid of technical stuff, such as the command line. If the site was called NewbieNews then your criticism might have been warranted, but as it stands now I think it's a bit exaggerated.

Reply Score: 3

v Tomahawk Desktop comes with built-in tools
by Tarsier on Tue 18th Apr 2006 05:18 UTC
What about ifolder ?
by searly on Tue 18th Apr 2006 08:28 UTC
searly
Member since:
2006-02-27

What about ifolder. Havn't used it myself, but isn't that the sort of idea to always keep your machines in sync with the latest files?

Reply Score: 1

RE: What about ifolder ?
by raxtor on Tue 18th Apr 2006 11:00 UTC in reply to "What about ifolder ?"
raxtor Member since:
2006-03-20

Yes, iFolder can keep your files in sync across multiple PCs. You can even share files with others, if you wish. See www.ifolder.com for more info.

Reply Score: 1

Unison bi-directionel syncing
by makkus on Tue 18th Apr 2006 11:56 UTC
makkus
Member since:
2006-01-11

I use Unison for this sort of job! It synchronize bidirectionel and does a very good job.

Reply Score: 2

MS SyncToy
by sean batten on Tue 18th Apr 2006 12:57 UTC
sean batten
Member since:
2005-07-06

I've been using MS SyncToy to sync up some pcs. It's free and seems to do the job. You've got various options echo, combine and subscribe. I'm sure it's not the most feature rich app around, but it's free and does everything I need to.

Reply Score: 1

Linuc success
by snowflake on Tue 18th Apr 2006 17:55 UTC
snowflake
Member since:
2005-07-20

>This is OSNews, a site for geeks and people who are not >afraid of technical stuff, such as the command line. If >the site was called NewbieNews then your criticism might >have been warranted, but as it stands now I think it's a >bit exaggerated.

You're right of course, this site is not meant for the general user but for specialists. I take back what I said with regard to readers of this site, the console is the perfect interface for them. However for the general user and with the aim of making Linux more applicable to the 'masses' there is always room for 'easier to remember' tools.

I was however dissappointed at some of the other remarks from the specialists on this site. The testosterone that comes with some Linux users is the bane of the community and I believe they should recongnise that Linux today is not just for the specialist but also for the general user who has no time for console syntax or semantics. I assume we're on the same book with regard to wishing Linuxs' success.

Reply Score: 2

RE: Linuc success
by porcel on Wed 19th Apr 2006 00:21 UTC in reply to "Linuc success"
porcel Member since:
2006-01-28

Try grsync then and stop whining. It has a nice and easy to use GUI for rsync.

Reply Score: 1

Idiots
by snowflake on Wed 19th Apr 2006 04:36 UTC
snowflake
Member since:
2005-07-20

>Try grsync then and stop whining. It has a nice and easy
>to use GUI for rsync.

It's not whining you idiot, it's trying to balance the two world that Linux is serving.

Reply Score: 1