ds (as in «Desktop Synchronization»)
«ds is a command line tool for manual, but quick and easy one-way syncing/mirroring of data to/from remote hosts. It uses rsync(1), ssh(1) and gconftool-2(1) to accomplish its tasks.»
I tend to switch between different computers, and I wanted some command line utility which made explicit synchronization of application data and configuration easier than having to invoke rsync directly. The result of this was ds*, which mainly works as a convenient wrapper around rsync, allowing you to define named sets of data (typically files/directories under your $HOME directory). These «sync items» can then be pushed or fetched to/from remote hosts with ease. It is meant to be used interactively and has support for generating Bash-compatible command line auto-completion code. Ds itself is written in POSIX compliant plain Bourne shell and is compatible with for instance dash, which runs much faster than standard GNU bash. Dash also happens to be the default «/bin/sh» implementation on Ubuntu/Debian.
* Used to be called «dsync», but I renamed it.Get it here: ds.sh, version 0.87 (2010-10-29) [PGP signature: ds.sh.asc]
Version 0.87:
- Use gconftool-2 instead of gconftool.
Version 0.86:
- Tool renamed to «ds». As a result of this, all related default config and log files have also been renamed. There are also changes to config file keywords. See «ds conf example».
- Added possibilty to display parsed config for only selected items and groups.
- Re-worked item flags (config format change after this commit).
- A number of clean-ups in code to reduce size and number of helper functions.
- Cleaned up help, only show short help by default. More detailed instructions can be viewed with «ds -H».
- Added possibility of configuring default host in environment.
- Remove long version of options as part of code cleanup, use getopts sh-builtin to parse options.
- Fix broken 'always_ask' config flag and '-i' (interactive) option.
Version 0.81:
- Fixed a couple of buglets in logging.
Version 0.80:
- Add support for item groups
- Logging clean-ups and improvements
Version 0.75:
- Added support for colorizing log display when `--color' option is used.
- Fixed some bugs in remote log file display.
- Added option `--nolog' to disable writing to log files.
Version 0.70:
- Complete config parser rewrite (way faster, allows multiple values per keyword and handles quoting properly).
- Other smaller improvements, bugfixes and cleanups.
Simple example to demonstrate typical usage:
$ cat ~/.ds.conf # contents of config file # Default host to sync to/from default_host host.net # The Foo item, with files/dirs relative to $HOME # Directories are always synced recursively. item Foo files foofile1 foofile2 foofile3 dirs foodir1/ bardir2 group default $ ds push Foo to host.net # update Foo on host.net # .. Do stuff with Foo resoures on host.net .. $ ds fetch # fetch Foo (synced by default) from default host (host.net) $ ds log # show sync log $ ds log remote host.net # show sync log on remote host host.net $ ds -H # show detailed help $ ds conf example # show example config
Note: The default behaviour of ds is to do proper mirroring when pushing or fetching data. This means that it can delete files or overwrite newer files at the destination of a synchronization (rsync(1) `--delete' and `-a' options). This is default behaviour to ensure consistency of typical application configuration data, but can be overriden in the config either for particular items or globally. Also, there is no conflict handling, because that is what I consider out of scope for this tool. Using the sync log, you can determine when and where an item was last synced and act accordingly. See help and config examples and make sure you understand it.