Running multiple computers
I'm a multi-computer user. I have my laptop, because a laptop is a damned handy thing to have, but I wouldn't willingly part with my desktop, because I like having a system I can incrementally upgrade, load up with extra hard drives, keep a Windows partition for gaming on, and so forth. I may soon start using an office computer, too, bringing the number of my actively used computers to three. This is all very convenient, except for keeping things synchronised across different systems.
There are lots of ways of doing this. I should know; I have used several and am using several more now. One, a very bad one, is my original way, used not because I ever thought it was intelligent but because it doesn't take any setup: Copy over all pertinent documents, copy them back and forth as needed (whether on a USB drive, or by ssh/scp, or by emailing it to yourself, or using online file storage, or …). The problem with this is … well, it sucks. It's work intensive and awkward and it's easy to forget. Here's how I improved upon this terrible solution …
If you're not a geek, you may want to skip the rest of this post. In fact, if you're not a serious geek, you may want to skip at least to the last section.
Home directory management with subversion (geekiness alert: high)
I finally decided to do the logical thing and move my entire (well, almost) home directory to a version control system—Subversion, specifically. I'm not the first to do this, nor is Subversion the only system to be used thus; googling, I happened on a guide to do this with cvs—I just prefer Subversion. Either way, the benefits of this should be obvious (to the geekily endowed among us): By checking out this repository on multiple machines, I get a very nice, distributed backup of my files. Updating is trivial (svn up), distributing changes is trivial (svn commit), and if I happen to forget updates here and there, well, merging is hardly new to a version control system. Of course there are drawbacks, some of which I care about, and some of which don't bother me: It takes up more space, for one, but that's not really a problem for me—I don't keep very large files (music, movies and such) in my home directory, and I have a server in my closet with an 80 GB hard drive and only one user. If you don't have access to so large a repository, you may want to be more careful about what to commit, but I'm sure we all have a lot of stuff that's small on disk but very handy to distribute (and important to back up), like text documents and, oh yeah, source code.
Another drawback, and this one actually irks me more, is that normal file management tools don't really work very well. It's usually fine when using a shell environment—if I have to use svn mv instead of mv, well, no big deal (I imagine some more sophisticated commands, like rename, would be less pleasant, but I'm neither a bash nor a Subversion expert at this point). Graphical tools, however, are less easily adapted. I do tend to use Nautilus from time to time, and I find it much more convenient than the shell for certain tasks, especially when individual files have to be selected out of large directories. Well, I can still do that for reading and accessing files, but not for renaming or moving. There are graphical browsers for Subversion repositories, but I haven't found one that I particularly like. (Suggestions? GTK applications vastly preferred.)
That aside, I'm finding this very convenient, and I feel safer knowing that even though I'm terrible at backing things up, I now have all my important documents in three places (my desktop, my laptop, and the repository on my server).
Very very brief howto
At Brett's suggestion, I set this up by creating an empty repository on the server (svnadmin create $HOME/homedir), and on my desktop (which had the up-to-date copies of the documents I wished to commit), I simply checked out the empty repository to my homedirectory (cd ; svn checkout svn+ssh://my_server/home/petter/homedir .), and explicitly added all the folders I wanted mirrored (via svn add $FOO, obviously).
In order to filter out all the stuff I don't want mirrored (the majority of my configuration files, for example, and temp directories) I list them all in a (mirrored) file called .svnignore (I initialised it with cd ; for i in `ls -d .??*` ; do echo $i >> .svnignore ; done, then added to it as needed), and run svn propset svn:ignore -F .svnignore . to update the repository data. If there's a better way to do this—there probably is—feel free to tell me.
rsyncing large, centralised files (geekiness alert: high)
For certain things, I synchronise things differently. Large files, like music and videos, I rsync between my desktop and server; this is fine for things where there's a dedicated master copy to synchronise with (as is the case for my music collection, which lives on my desktop and is merely backed up to the server, but obviously not for documents).
Incredibly brief howto
rsync -ave ssh --delete /home/dir_with_large_files/ my_server:/home/dir_with_large_files_mirrored
Centralised internet services (geekiness alert: medium)
Internet related services are also a bit different. Here I realised that it's really fine to rely on centralised services, because if I can't access the net, it's a moot point. Email is very simple—IMAP to the rescue! Most of the mail servers I use are IMAP servers, and I run an IMAP server on my own server machine—this now replaces my “Local folders”: My mail archives would kind of overwhelm some servers, but again, I have gigabytes and gigabytes of space on my own machine (and my mail archives only take up 221 MB). (Again, I get free backups by simply telling my IMAP clients to keep offline copies of all messages.)
Feeds (Atom, RSS) presented a unique challenge—I'm rather fond of Liferea, but it's very annoying to read some feeds on one machine, move to another, and find that all the read feeds are now marked as unread (sometimes going back several days, which can be quite a lot of posts—I have several news feed subscriptions). Today, I decided to simply move to Google Reader and collate all my feeds server-side; I can access it from whatever computer I like, and it will track what I've read for me. It's not ideal—I tend to like dedicated clients (as long as they integrate well with Gnome), I'm not a huge fan of web interfaces, and I miss Liferea's ability to authenticate (it would allow me to log in and read friends-only LiveJournal posts), but it's not worth the hassle.
There are possibly minor errors in this post (I wrote it after the fact, as it were, rather than copying the actual live commands). If there are, and if you point them out so I can correct them, I will send you a cookie.
There are lots of ways of doing this. I should know; I have used several and am using several more now. One, a very bad one, is my original way, used not because I ever thought it was intelligent but because it doesn't take any setup: Copy over all pertinent documents, copy them back and forth as needed (whether on a USB drive, or by ssh/scp, or by emailing it to yourself, or using online file storage, or …). The problem with this is … well, it sucks. It's work intensive and awkward and it's easy to forget. Here's how I improved upon this terrible solution …
If you're not a geek, you may want to skip the rest of this post. In fact, if you're not a serious geek, you may want to skip at least to the last section.
Home directory management with subversion (geekiness alert: high)
I finally decided to do the logical thing and move my entire (well, almost) home directory to a version control system—Subversion, specifically. I'm not the first to do this, nor is Subversion the only system to be used thus; googling, I happened on a guide to do this with cvs—I just prefer Subversion. Either way, the benefits of this should be obvious (to the geekily endowed among us): By checking out this repository on multiple machines, I get a very nice, distributed backup of my files. Updating is trivial (svn up), distributing changes is trivial (svn commit), and if I happen to forget updates here and there, well, merging is hardly new to a version control system. Of course there are drawbacks, some of which I care about, and some of which don't bother me: It takes up more space, for one, but that's not really a problem for me—I don't keep very large files (music, movies and such) in my home directory, and I have a server in my closet with an 80 GB hard drive and only one user. If you don't have access to so large a repository, you may want to be more careful about what to commit, but I'm sure we all have a lot of stuff that's small on disk but very handy to distribute (and important to back up), like text documents and, oh yeah, source code.
Another drawback, and this one actually irks me more, is that normal file management tools don't really work very well. It's usually fine when using a shell environment—if I have to use svn mv instead of mv, well, no big deal (I imagine some more sophisticated commands, like rename, would be less pleasant, but I'm neither a bash nor a Subversion expert at this point). Graphical tools, however, are less easily adapted. I do tend to use Nautilus from time to time, and I find it much more convenient than the shell for certain tasks, especially when individual files have to be selected out of large directories. Well, I can still do that for reading and accessing files, but not for renaming or moving. There are graphical browsers for Subversion repositories, but I haven't found one that I particularly like. (Suggestions? GTK applications vastly preferred.)
That aside, I'm finding this very convenient, and I feel safer knowing that even though I'm terrible at backing things up, I now have all my important documents in three places (my desktop, my laptop, and the repository on my server).
Very very brief howto
At Brett's suggestion, I set this up by creating an empty repository on the server (svnadmin create $HOME/homedir), and on my desktop (which had the up-to-date copies of the documents I wished to commit), I simply checked out the empty repository to my homedirectory (cd ; svn checkout svn+ssh://my_server/home/petter/homedir .), and explicitly added all the folders I wanted mirrored (via svn add $FOO, obviously).
In order to filter out all the stuff I don't want mirrored (the majority of my configuration files, for example, and temp directories) I list them all in a (mirrored) file called .svnignore (I initialised it with cd ; for i in `ls -d .??*` ; do echo $i >> .svnignore ; done, then added to it as needed), and run svn propset svn:ignore -F .svnignore . to update the repository data. If there's a better way to do this—there probably is—feel free to tell me.
rsyncing large, centralised files (geekiness alert: high)
For certain things, I synchronise things differently. Large files, like music and videos, I rsync between my desktop and server; this is fine for things where there's a dedicated master copy to synchronise with (as is the case for my music collection, which lives on my desktop and is merely backed up to the server, but obviously not for documents).
Incredibly brief howto
rsync -ave ssh --delete /home/dir_with_large_files/ my_server:/home/dir_with_large_files_mirrored
Centralised internet services (geekiness alert: medium)
Internet related services are also a bit different. Here I realised that it's really fine to rely on centralised services, because if I can't access the net, it's a moot point. Email is very simple—IMAP to the rescue! Most of the mail servers I use are IMAP servers, and I run an IMAP server on my own server machine—this now replaces my “Local folders”: My mail archives would kind of overwhelm some servers, but again, I have gigabytes and gigabytes of space on my own machine (and my mail archives only take up 221 MB). (Again, I get free backups by simply telling my IMAP clients to keep offline copies of all messages.)
Feeds (Atom, RSS) presented a unique challenge—I'm rather fond of Liferea, but it's very annoying to read some feeds on one machine, move to another, and find that all the read feeds are now marked as unread (sometimes going back several days, which can be quite a lot of posts—I have several news feed subscriptions). Today, I decided to simply move to Google Reader and collate all my feeds server-side; I can access it from whatever computer I like, and it will track what I've read for me. It's not ideal—I tend to like dedicated clients (as long as they integrate well with Gnome), I'm not a huge fan of web interfaces, and I miss Liferea's ability to authenticate (it would allow me to log in and read friends-only LiveJournal posts), but it's not worth the hassle.
There are possibly minor errors in this post (I wrote it after the fact, as it were, rather than copying the actual live commands). If there are, and if you point them out so I can correct them, I will send you a cookie.
no subject