Catch up on stories from the past week (and beyond) at the Slashdot story archive

 



Forgot your password?
typodupeerror
×
Data Storage

How Do You Sync & Manage Your Home Directories? 421

digitalderbs writes "A problem plaguing most people with multiple computers is the arduous task of synchronizing files between them: documents, pictures, code, or data. Everyone seems to have their own strategies, whether they involve USB drives, emailed attachments, rsync, or a distributed management system, all of which have varying degrees of success in implementing fast synchronization, interoperability, redundancy and versioning, and encryption. Myself, I've used unison for file synchronization and rsnapshot for backups between two Linux servers and a Mac OS X laptop. I've recently considered adding some sophistication by implementing a version control system like subversion, git, or bazaar, but have found some shortcomings in automating commits and pushing updates to all systems. What system do you use to manage your home directories, and how have they worked for you for managing small files (e.g. dot configs) and large (gigabyte binaries of data) together?"
This discussion has been archived. No new comments can be posted.

How Do You Sync & Manage Your Home Directories?

Comments Filter:
  • Windows users? (Score:2, Informative)

    by DoofusOfDeath ( 636671 ) on Tuesday June 23, 2009 @03:28PM (#28443571)

    Do Windows users even have anything like this, aside from Active Directory?

  • And the Large Files? (Score:2, Informative)

    by eldavojohn ( 898314 ) * <`eldavojohn' `at' `gmail.com'> on Tuesday June 23, 2009 @03:35PM (#28443699) Journal
    I've used subversion quite a bit and we simply avoid committing Java archives and instead use Maven2 to get those. This is because it seems to take up a lot of space and time with large files. Maybe this is typical of any versioning system but I do not know enough about git. From Subversion's best practices:

    Be patient with large files

    A nice feature of Subversion is that by design, there is no limit to the size of files it can handle. Files are sent "streamily" in both directions between Subversion client and server, using a small, constant amount of memory on each side of the network.

    Of course, there are a number of practical issues to consider. While there's no need to worry about files in the kilobyte-sized range (e.g. typical source-code files), committing larger files can take a tremendous amount of both time and space (e.g. files that are dozens or hundreds of megabytes large.)

    To begin with, remember that your Subversion working copy stores pristine copies of all version-controlled files in the .svn/text-base/ area. This means that your working copy takes up at least twice as much disk space as the original dataset. Beyond that, the Subversion client follows a (currently unadjustable) algorithm for committing files:

    * Copies the file to .svn/tmp/ (can take a while, and temporarily uses extra disk space))
    * Performs a binary diff between the tmpfile and the pristine copy, or between the tmpfile and an empty-file if newly added. (can take a very long time to compute, even though only a small amount of data might ultimately be sent over the network)
    * Sends the diff to the server, then moves the tmpfile into .svn/text-base/

    So while there's no theoretical limit to the size of your files, you'll need to be aware that very large files may require quite a bit of patient waiting while your client chugs away. You can rest assured, however, that unlike CVS, your large files won't incapacitate the server or affect other users.

    Really, I think he's asking for one tool to do both small files and large files when (in my mind) it makes more sense to back up ISOs and MP3s over longer periods of time than my source code or documents that I may edit and change daily.

    Subversion for source control. A simple script that pushes large files to an external drive. That's all I do. Bulletproof? No way. But it sounds like he's devoting a lot of time to this. I guess he must have a lot more computers than I do.

  • Beyond Compare (Score:3, Informative)

    by Anonymous Coward on Tuesday June 23, 2009 @03:37PM (#28443729)

    On the windows side there is a great utility called Beyond Compare, around $30, that I have used to do this. I even had a small client once that could not afford a real backup software, so we faked the backup using portable USB hard drives and the Beyond Compare utility to sync her server and desktop to the drives. Worked quite great and the while thing was done for under $200.

  • by Drizzt Do'Urden ( 226671 ) on Tuesday June 23, 2009 @03:39PM (#28443765) Homepage

    At home, I've got a Linux server hosting an LDAP structure to mimic MacOS X Server's config. It is sharing my home directory via NFS. My Macs sync this home directory on login and logout, so all my personnal data is centalized for easy backup and available on any Mac I happen to add to my home network.

  • rsync (Score:2, Informative)

    by john_a_smith ( 1366597 ) on Tuesday June 23, 2009 @03:45PM (#28443875)
    Primitive, but it works for me.
  • Re:Svn (Score:4, Informative)

    by WillKemp ( 1338605 ) on Tuesday June 23, 2009 @03:46PM (#28443885) Homepage

    If i'd elaborated, i wouldn't have made first post!

    However, i use subversion for two things - backup and syncing my development system with my remotely hosted web server. Neither of which is really how i "sync and manage home directories", but if i needed to do that subversion is what i would use.

    Some months back, i foolishly pointed to my web hosting service that there was a serious security hole in the way their system (cpanel) was configured for subversion - and they killed the subversion service and haven't reinstated it. So i have to do 'svn update' over an sshfs virtual file system, which is mildly irritating.

    Anyway, i've got a single repository set up on my system and i check in all new web sites i'm working on. Then i check them out onto the server - and update the files on the server with 'svn update'. It's easy, reliable, and reasonably fast. It also makes backup nice and easy, as i just sync the repository with a mirror on an external hdd.

  • Re:Dropbox (Score:5, Informative)

    by buchner.johannes ( 1139593 ) on Tuesday June 23, 2009 @03:47PM (#28443909) Homepage Journal

    Have a look at Jake [slashdot.org]. Official website: Jake [jakeapp.com]

    It is aimed for the average user (no server setup needed) and provides a syncing solution across the Internet with a nice UI. Free and open source, available for all operating systems.

    Check it out!

  • Webdav, SVN, etc (Score:3, Informative)

    by fermion ( 181285 ) on Tuesday June 23, 2009 @03:51PM (#28443999) Homepage Journal
    For smaller files, I keep everything controlled using SVN. That is code, office type files, that sort of thing. I have a BASH script that pretty reliably works to commit, add, and update. Everyone once in a while I have to go in and manually fix something. I suppose I could put a chron entry in to make it automatic, but it is just as easy to go to the shell and update everything. Setting up the server was no issue, and it is an offsite backup.

    For items that are larger, or that do not change so often, I use iDisk. This is just a fancy Webdav server that I do not have to manage.

    I keep programs on an external hard disk. This is where I also keep my photo library and music and videos. I use one machine for Photos, so I do not really have anything to sync there. My music is not synced either, but I have used some third party software to hel with that.

    It is getting to the point where if something goes wrong with a machine, I can have new one set up will all my data in a day. In normal circumstances, I can use any one of three machines and prety much have up to date information.

  • by Binkleyz ( 175773 ) on Tuesday June 23, 2009 @03:59PM (#28444149) Journal

    Doubletake software makes an enterprise ready, real time replication suite.

    It does block level replication, so only the changed bits of, say, a 10Gb databse gets changed.. It uses on the fly en/decryption so that the data streams are somewhat smaller than they would be otherwise..

    I work for a Fortune 10 company, and when we have a need for real-time data replication, this is what we use.

  • by goombah99 ( 560566 ) on Tuesday June 23, 2009 @04:00PM (#28444165)

    for backups I used to swear by rsync plus hardlinks. But since time machine came out it's oh so much much better. For one thing rsync is still a bit unstable on huge directory trees that contain lots of hard links. And it also boofs on some extended type attributes, forks and file types, though it keeps getting better (perhaps it's perfect now). Rsync + hardlinks also does not retain the ownership and privledges and ACL faithfully either.

    But even if Rsync + hardlinks didn't have those troubles, time machine is so flawless it's just the thing to use. What is especially nice about time machine is the recovery and inspection process. it's not too hard to figure out what files chaged (there's even a 3rd party gui application for this) and because this info is stored in meta data it's faster and more relaible to retreive than a massive FIND command looking at time stamps. The time machine interface for partial recoveries is intuitive and easy to drill down. In many cases it's even application aware so you can drill not on the file system itself but on say your mail folders in the mail application. this is actually a pretty stunning achievement that needs to be seen to be believed how paradigm shifting it is.

    And full recoveries could not be easier. you just boot off the CD and within ten clicks you have picked the souece and destination and it has done a series of idiot checks. While that might not seem too amazing, it sure is comforting. It's a mildly nerve wracking process of trying to recover from a back-up cause there's lots of ways to goof and maybe even wreck your original ( like oops, I didn't do a -delete, or I didn't tell it to reassign links, or worse I copied the wrong direction).

    Here's a super nice tip: you can have two disks operating with time machine that you rotate. Actually the best way i've found is to have one constantly attached then on fridays attach the other one, redirect time machine to it, let it back up all the changes since last friday, then detatch it and let time machine go back to the main disk.

    You can even use this as a way to sync your two computers though it's better as a backup than as a synch. have time machine back up just your home directory to a thumb drive, take this from home to work. plug it to the drive at work, back it up. then revert this to the backup from home. now home and work are synced plus, if there was one special file or two that was newer at work, well you have that in the backup you made! ( by the way to do this kind of thing requires fiddling with the backup cookie so two computers can share the same repository. google this if you want o know how)

  • SSHFS (Score:2, Informative)

    by WheelDweller ( 108946 ) <`moc.liamg' `ta' `rellewDleehW'> on Tuesday June 23, 2009 @04:01PM (#28444189)

    Look into sshfs. Keep your home machine ssh-reachable (isn't it already?) and you'll be able to ssh into it, mounting the filesystem on your desktop. It's convenient, secure, and effective. Works anywhere ssh does. Good stuff!

  • Re:Windows users? (Score:3, Informative)

    by cdub1900 ( 1167623 ) on Tuesday June 23, 2009 @04:01PM (#28444197)
    Windows Live Mesh
    https://www.mesh.com/ [mesh.com]

    "With Live Mesh, you can synchronize files with all of your devices, so you always have the latest versions handy. Access your files from any device or from the web, easily share them with others, and get notified whenever someone changes a file.

    Working on one computer, but need a program from another? No problem. Use Live Mesh to connect to your other computer and access its desktop as if you were sitting right in front of it. "
  • unison/sshfs/rsync (Score:2, Informative)

    by Cocoronixx ( 551128 ) on Tuesday June 23, 2009 @04:04PM (#28444247) Homepage

    My current setup is a combo of unison/sshfs/rsync.. I've been using it for quite a while at this point, and it works so well that I don't even give it any thought anymore.

    I have a Media Center/Fileserver box at my house that is always on, and acts as the 'master' copy of the home directory, on all my workstations my .xinitrc/.xsession calls unison to sync my home dir with the server root as the preferred copy, then calls my WM, after my WM exits, unison is called again with the local homedir as the authoritative copy. A well-crafted ignore list is crucial, ignoring things like temporary file patterns, mozilla cache, machine-specific data, obscenely large files, etc.

    I use sshfs-fuse for any of the above mentioned ignored files, sshfs allws you to mount remote filesystems locally, tunneling through ssh (or something like that).

    Finally, rsync can be used to give time machine like backups. In my case, I backup to USB drive connected to the fileserver, which I only turn on when running backups.

    This is for the most part Linux-only, but unison has a windows binary available, and could probably be used to sync to windows automagically.

  • Re:Dropbox (Score:4, Informative)

    by darrylo ( 97569 ) on Tuesday June 23, 2009 @04:07PM (#28444305)

    Yes, dropbox is very nice. I'll second the recommendation. Dropbox can also automatically keep previous versions of files around. Works on PC, Mac, and linux.

    If you need security, truecrypt with dropbox is nice. Dropbox supports incremental (delta) change file uploads/downloads, which makes large-ish truecrypt containers useful on dropbox. The only real limitations are that (1) you have to unmount the truecrypt container before synchronization can occur, and (2) you have to insure, manually, that only one PC/Mac/linux box is accessing the truecrypt container at any one time.

    An alternative to dropbox is syncplicity, but I haven't tried it. The feature set looks similar, though.

    Another alternative is jungledisk, which uses Amazon S3 to store your data. The advantages here are that everything is encrypted with a key (stored only at your end, unless you enable the web interface), that you pay only for what you use, and that there's no limit on storage capacity (as long as you have money). Disadvantages include:

    • Incremental/delta file downloads don't exist (makes truecrypt hard to use).
    • Incremental file uploads exist, for an extra $1/month fee.
    • You pay for bandwidth, and the bandwidth costs can add up.
  • Re:Myself... (Score:3, Informative)

    by theJML ( 911853 ) on Tuesday June 23, 2009 @04:13PM (#28444395) Homepage

    But doesn't that leave you open to crisis when one dies?

    Or is TFA not talking about backup so much?

    Personaly, though I have different uses for various systems, often find that I want to access the same data and having it in a central location is the best way to store it. So I have a central Gentoo install on a low power Geode board (runs at about 5 watts, up to 15 watts with drives spinning), with mirrored and regularly backed up storage (to tape and exchanged with a remote location's tape set when possible (like xmas time when I go to my parents who are 300 miles away, don't really care enough for it to be more frequent than that)). Each server connects to this central location with nfs or samba/cifs and all 'serious work' is done on those shares.

    I've been looking into svn to help manage the various changes to files I make over time, but I haven't really migrated things to it yet.

    I've also stored some important things in 'the cloud' on sites like google docs with much success.

  • Re:Beyond Compare (Score:1, Informative)

    by Anonymous Coward on Tuesday June 23, 2009 @04:23PM (#28444551)

    BeyondCompare is also available for Linux now.

  • Apple MobileMe (Score:2, Informative)

    by Brice21 ( 763827 ) <exmachina@gmail.com> on Tuesday June 23, 2009 @04:29PM (#28444645) Homepage
    I use the MobileMe service from Apple. The 20 Gb iDisk is enough for syncing files between my several computers. It's mounted on the desktop of my various Macs and with the iDisk's cache, copying files is instantaneous and I can work on my files while offline. When I get back to an internet connection, it syncs. I can also access my iDisks using the webinterface or mount the iDisk in WebDAV on Windows. Also MobileMe Sync my iPhone and my computers Calendars, Address Book, Keychains, Bookmarks, Dashboard Widgets, Dock Items, Mail Accounts, rules, signatures, smart mailboxes, Notes, Preferences (including serial numbers) and FTP favorites. I can use the me.com website to access my adress book, calendars, files and emails from any web browser. Configuration is very simple (login, password, thick a checkbox) and require no software install.
  • Re:Svn (Score:3, Informative)

    by morgauxo ( 974071 ) on Tuesday June 23, 2009 @04:37PM (#28444817)
    The biggest shortcoming of CVS that I know is the lack of ability to rename a file. Yes, you can copy it then delete the original but CVS sees this as a new file with no revision history. If I understand correctly subversion was created by former CVS users to overcome a few shortcomings of CVS with this being the biggest one. Thus SVN has a similar "feel" though not identical commands to CVS and a superior feature set.
  • Re:Dropbox (Score:3, Informative)

    by namityadav ( 989838 ) on Tuesday June 23, 2009 @04:40PM (#28444879)
    I love Dropbox. It does it's job well and quietly. However, you are correct that this is not a very secure solution. Although Dropbox claims encryption for transfer and storage, the keys used for transfer and storage are Dropbox's. So, Dropbox employees can still see your docs. And considering that this discussion is about the "Home Directories," I wouldn't be very happy with that level of security. I know that one can use TrueCrypt to work around this problem .. but then you need to remember to mount / dismount the TrueCrypt drive anytime you make changes to your documents. Not a very good solution either.
  • Re:Svn (Score:3, Informative)

    by dword ( 735428 ) on Tuesday June 23, 2009 @05:10PM (#28445381)
    1. You're comparing CVS to notepad? You can hardly say CVS is a rudimentary VS. Basically, what you're saying is that no matter what the job is, I should always use the biggest hammer.
    2. I believe you believe wrong and that this situation is best summed up as "I don't miss something I don't need". The simplicity of the system I put up together (which took just a few minutes and a few lines of bash) is exactly what I need.
    3. If it's not broken, don't fix it.
    4. You have no idea what I need, so how can you possibly assume I am missing anything?
  • Re:Dropbox (Score:3, Informative)

    by buchner.johannes ( 1139593 ) on Tuesday June 23, 2009 @05:27PM (#28445635) Homepage Journal

    Sure. Either look in the http://dev.jakeapp.com/documents/3 [slashdot.org]">introduction for new developers or on the mirror site
    mirror site [univie.ac.at].
    We don't have a git daemon just yet.

  • Re:Svn (Score:4, Informative)

    by xaxa ( 988988 ) on Tuesday June 23, 2009 @06:18PM (#28446351)

    I have two main computers, desktop and server.

    File layout:
    desktop:Documents -- everything I want backed up regularly
    desktop:Server -- symlink to latest backup from server
    server:Documents -- a few server-specific files, and stuff I always want accessible (I turn my desktop off if I'm not using it).
    server:Desktop -- symlink to latest backup from desktop

    There is an @reboot cronjob on the desktop PC to backup the server, and tell the server to backup the desktop. I use the rsync --link-dest thing so I can have incremental backups (using hard links for files that haven't changed). There are a few other additions -- automatically deleting old backups (except keep a backup from every 10th day) and updating the symlink to the latest successful backup.

    The script is written in ZSH, to take advantage of the fantastic globbing that's available.
    The most important lines in the script are:

    older=($backups/$user/*(/om))
    ($older is now an array of directories, ordered newest-to-oldest).
    rsync --verbose -8 --archive --recursive --link-dest=${^older[1,20]} \
        --files-from=$scripts/${from}2$HOST-I-$user \
        --exclude-from=$scripts/${from}2$HOST-X-$user \
        $user@$from:/ $backups/$user/$date/

    (The variables like $from and $HOST are because I use the same script to copy some stuff to my laptop, but that has a small drive so I don't copy everything. I think the strange syntax after --link-dest expands the array like --link-dest=/dir/one --link-dest=/dir/two ... --link-dest=/dir/twenty)

    over2weeks=( $backups/*/???????[012346789]-????(/Omm+14) )
    end=$(( $#over2weeks - 5 ))
    rm -rf $over2weeks[1,$end]
    ($over2weeks is an array of directories, being backups not taken on the 5th, 15th or 25th day of the month, and at least 14 days old.
    $end is the length of the array minus 5)

  • by rpwoodbu ( 82958 ) on Tuesday June 23, 2009 @06:43PM (#28446663)

    I have found that using Subversion (svn) with the aid of a bash script that is run manually actually works really well and provides a number of special advantages. Here's how I have it constructed:

    First, I don't actually make my whole home directory a svn checkout. I have a subdirectory in it that is the checkout, and my bash script ensures there are symlinks into it for the things I want sync'd. This makes it easy to have some differences between locations. In particular, I can have a different .bashrc for one machine than another, but keep them both in svn as separate files; it is just a matter of making the symlink point to the one I want to use in each location. My bash script will make the symlink if the file doesn't exist, and warn if the file does exist but isn't a symlink. It does this for a number of files.

    Another benefit of this method is that I don't put all my files in one checkout. The core files I'll want in all my home directories (e.g. .bashrc, .vimrc, ssh .config and public keys, etc.) go in a checkout called "homedir". But my documents go elsewhere. And my sensitive files (e.g. private keys) go somewhere else still. I choose what is appropriate to install at each location (usually just the "homedir" checkout on boxes I don't own). My bash script detects which checkouts I have and does the appropriate steps.

    The bash script not only sets up the symlinks but it also does an "svn status" on each checkout so I'll know if there are any files I've created that I haven't added, or any files I've modified that I haven't committed. I prefer not to automate adds and commits. I'll definitely see any pending things when I run my sync script, and can simply do an "svn add" or "svn commit" as necessary.

    I also prefer not to automate the running of the sync script. I like being in control of my bandwidth usage, especially when connected via slow links (e.g. Verizon EV-DO, AT&T GPRS). Plus dealing with conflicts is much easier when it is interactive (although I can usually avoid that scenario). It also simplifies authentication to run it from my shell, as it can just use my ssh agent (which I forward, which is setup in my sync'd ssh config).

    The sync bash script takes care of a few other edge-case issues, like dealing with files in ~/.ssh that have to have certain permissions and whatnot. And I've taken care to ensure that the script doesn't just blow away files; it will warn if things don't look right, and leaves it to me to fix it.

    Using Subversion has another big advantage: it is likely to be installed already in many places. So when I'm given an account on someone's computer, I can usually get my environment just the way I like it in a few short steps:

    svn co svn+ssh://my.server.tld/my/path/to/svn/trunk/homedir ~/homedir
    ~/homedir/bin/mysync # This is my bash script to do the syncing
    # Correct any complains about .bashrc not being a symlink and whatnot
    ~/homedir/bin/mysync
    # Log out and back in, or source .bashrc

    No fuss, no muss. No downloading some sync package and building it just to get your .bashrc or .vimrc on a random box, or asking the admin to install something. Subversion is usually there, and even if it isn't, most admins are happy to install it. Subversion deals well with binary files, and even large files. For bulk things (like a music library), I'm more likely to rsync it, partly because it is bulk, partly because it doesn't benefit from versioning, and partly because it only needs to be a unidirectional sync. I could easily add that to my sync script.

    I am simply in the habit of typing "mysync" from time to time (my .bashrc puts ~/bin/ in my $PATH). This works for me very nicely. Some people may prefer a little more automation, and of course my script could automatically do adds and commits, and even skip the log messages. But I prefer a bit more process; after all, this is my data we're talking about!

    If there is interest, I may post my sync script.

  • Git (Score:3, Informative)

    by kabloom ( 755503 ) on Tuesday June 23, 2009 @07:04PM (#28446891) Homepage

    I use a constellation of git repositories, and Joey Hess' mr [kitenet.net] tool to synchronize all of them. I have no automated commits -- I just remember to commit and update manually daily.

  • Re:Dropbox (Score:4, Informative)

    by Heir Of The Mess ( 939658 ) on Tuesday June 23, 2009 @08:05PM (#28447499)

    I tried LiveMesh too, but it would crash from time to time so it is no longer on my system

    I had problems with earlier versions of LiveMesh but I haven't had any problems for a while. For a few months from November 2008 to February 2009 I'd been using both DropBox and LiveMesh. Now I'm using just LiveMesh. For me what swung it for LiveMesh was:

    - Being able to sync any folder on my PC, e.g I sync my favorites folder between 4 PCs
    - Being able to easily control which PCs get updated with what as I don't want everything synced between all my PCs
    - Being able to configure folders to be transferred just PC to PC, e.g. I have 30GB of family photos that I sync between my wife, myself, and my parents accounts on their respective PCs. I don't need these photos in online storage

    One tip though when using such sync tools - keep a backup as if one person trashes the folder it trashes everyones folder

  • Re:Svn (Score:3, Informative)

    by Architect_sasyr ( 938685 ) on Tuesday June 23, 2009 @10:24PM (#28448361)
    I use a similar system with rdiff-backup. Example:
    desktop-pc$ rdiff-backup /mnt/server/Desktop/ ~/Desktop/
    desktop-pc$ rdiff-backup --remove-older-than 2W ~/Desktop/
    server$ rdiff-backup /mnt/desktop-pc/Documents/ ~/Documents/
    server$ rdiff-backup --remove-older-than 2W ~/Documents
    Note that I wrote that from memory, not from what my systems actually do. I'm in love with this damned program though - gone are the 90+ lines of bash I used to use for backing up my files, now I can do it in a couple of commands.
  • Re:Windows users? (Score:2, Informative)

    by EmmDashNine ( 1082413 ) on Wednesday June 24, 2009 @12:11AM (#28448985)

    Do Windows users even have anything like this, aside from Active Directory?

    robocopy.exe if you want to sync/mirror on the command line. It's available in a separate, downloadable resource kit.

  • Re:Windows users? (Score:3, Informative)

    by Z34107 ( 925136 ) on Wednesday June 24, 2009 @12:29AM (#28449065)

    Robocopy works really well, and comes with Vista and up (works on XP, too). More of a bulk file copy than a sync, though.

    Subversion may be overkill, but some nice free servers and clients exist for Windows. TortoiseSVN is a nice client that integrates with the shell; set up a server on a cheap home box and get a free dyndns alias.

    Newer versions of SyncToy seem to work pretty well, and they're stupid simple, but I haven't used them on anything more than a flash drive's worth of data. Ditto for the built-in "briefcases."

    The hardcore could use ImageX from the free WAIK, or even set up Windows Deployment Services, and create images of your entire machine. They're stored incrementally - the base image may be 50 GB, but every additional image will be tiny deltas.

    Short answer: no, other than Active Directory roaming profiles.

  • by jcn ( 55250 ) on Wednesday June 24, 2009 @04:39AM (#28450291) Homepage Journal
    You may want to check out

    Dan Kolleth's rant [hacker.dk]

  • Yes, at the NFS option there is a yellow pages services implicit. Try NIS, it will sync your UIDs and GIDs.

"Spock, did you see the looks on their faces?" "Yes, Captain, a sort of vacant contentment."

Working...