For email I use an IMAP server that I set up on my home network, it
is the best way to synchronize email.
For files, including configuration files, I use unison, along with a
script I wrote and a terminal command launcher to start it up at login.
Unison is a bi-directional, cross platform synchronization tool that
is very good at keeping things synchronized, and is much better than
rsync when things might change on either side. Unison, like rsync,
uses ssh to actually move the data around, but it keeps a database of
the status the files so it can tell add/delete/change of all files.
I note, make sure you use the same version of Unison on all your
systems.
Unison can use configuration files. One hint is, if you have a lot
of files to synchronize, split it up and use multiple sync jobs.
Since unison builds and checks a database of file metadata, the time
and memory to check a large set of files is much higher than multiple
smaller sets of files.
Unison configuration files use the extention .prf. You can also use
include statements to include additional files. Lines that begin
with a # symbol are comments and are not processed.
I tried a lot of methods to get it running automatically, including
automator, but found that a terminal autorun command was the easiest
way to do it.
Setup
- Download unison and then install it. I just downloaded the command
line version and then copied the executable to /usr/bin on each of my
MacOS X systems.
- Set up Unison configuration files for each area you want
- Set up the script run_unison.pl (change USER to your user directory)
- Set up a terminal autorun
- Open a terminal window
- select the menu File -> Save
- select "execute this command" and put in the run_unison.pl script,
with the path from your home directory (eg if you keep it in
Documents/unison the command would be Documents/unison/run_unison.pl.
- check execute command in a shell.
- run_unison.pl accepts -h for help and -v to give verbose output.
- it will save as a .term file which you can put into your login
items preference (preferences -> accounts -> login items) to have it
run at login.
- you can test the script in terminal.
Unison Mac downloads -
http://www.cs.haifa.ac.il/%7Eshuly/unison/
Unison -
http://www.cis.upenn.edu/~bcpierce/unison/
Unison configuration files go in "/Users/USER/Library/Application
Support/Unison". I create a file called "common" that contains teh
major configuration that is the same across all the configurations.
--- Common file
# (... other preferences ...)
rsrc = true
contactquietly = true
times = true
#prefer = newer
#repeat 600
# include batch on command line
#batch = true
# If any new preferences are added by Unison (e.g. 'ignore'
# preferences added via the graphical UI), then store them in the
# file 'common' rathen than in the top-level preference file
#addprefsto = common
# regexps specifying names and paths to ignore
ignore = Name {.DS_Store}
#ignore = Name temp.*
#ignore = Name *~
#ignore = Name .*~
#ignore = Path */pilot/backup/Archive_*
#ignore = Name *.o
#ignore = Name *.tmp
--- END common
--- Simple prc file
# Unison preferences file
include common
# (... other preferences ...)
ignore = Regex ar[a-z0-9]{32}
#ignores the unison database files.
# Roots of the synchronization
root = /Users/USER/Library/Application Support/Unison
root = ssh://USER

SYSTEM//export/eudora_folder/unison/scripts/londo
--- END
--- Complex prc file
# Unison preferences file
# (... other preferences ...)
include common
prefer = newer
# Roots of the synchronization
root = /Applications/Games
root = ssh://USER

SYSTEM//export/eudora_folder/unison/apps/Games
#
path = Marathon/Elite Force/BaseEF/save
path = Marathon/Elite Force II Folder/base/save
path = Starcraft Folder/Starcraft Files
path = Warcraft III Folder/Maps
path = Warcraft III Folder/Save
path = Age of Mythology/Savegame
path = Civilization III/Saves
path = Marathon/The Return Of The King/Save
#path =
-- END
--- Perl Script "run_unison.pl"
#!/usr/bin/perl -s
if ( $h ) {
print "Usage: $0 [-h|-v]\n";
exit 0;
}
$SWITCH = "-silent";
if ( $v ) {
$VERBOSE = 1;
$SWITCH = "-terse";
}
while ( 1 ) {

list = grep /\.prf$/, `ls "/Users/USER/Library/Application Support/
Unison"`;
#print "List:\n"; print join "",

list;
print scalar localtime(time()) . "\n";
foreach $_ (

list) {
#print "running $_\n" if $VERBOSE;
chomp;
$_ =~ /(\w+)\.prf$/;
my $profile = $1;
if ( $profile ne "" && $profile ne "default") {
print "$profile\n" if $VERBOSE;
# my

output = `unison $profile -batch -terse -prefer newer 2>&1`;
# my

output = `unison $profile -batch -terse 2>&1`;
# my

output = `unison $profile -batch -silent 2>&1`;
my

output = `unison $profile -batch $SWITCH 2>&1`;
if ( scalar

output > 0 ) {
print "$profile\n";
print join "",

output;
}
}
}
print "Sleeping for 10 minutes\n" if $VERBOSE;
sleep 600;
}
--- END Perl Script