rcsync - Synchronize configuration files across machines
In your $HOME/.rcsync:
$HOME/.rcsync
base_dir /home/supermario/rcsync <vim> filename /home/supermario/.vimrc template vimrc.tt <params> backupdir /tmp/vim </params> </vim>
In $HOME/rcsync/vimrc.tt:
$HOME/rcsync/vimrc.tt
set nocompatible set backup set backupdir=[% backupdir %] ...
From the command line:
rcsync vim
rcsync is a script to assist in synchronizing configuration files across different machines. Create templates for the configuration files you want synchronized, using template variables whereever you have machine-specific settings. Keep this folder synchronized across machines using whatever tool you choose - a version control system, a file syncing service such as Dropbox, rsync, etc. In a $HOME/.rcsync configuration file specify the directory with sycnronized templates as base_dir, and then for each configuration file (a.k.a. profile) create a section with the following parameters: filename - the location of the config file that needs syncing (i.e. the filename where the processed template will be written), template - the name of the tempalte to be used for this configuration file (under base_dir), and params - a block of parameter to be passed to the template. Run rcsync profile1 profile2 ... to sync the specified profiles. Template::Toolkit is used for template processing, and the settings (.rcsync) are in Config::General format.
rcsync
base_dir
filename
template
params
rcsync profile1 profile2 ...
.rcsync
Sync all profiles
List the names of all profiles
Print the path to the template for the specified profile
Specify a configuration file to use
Create a stub configuration file in <$HOME/.rcsync> if one does not exist yet
Print processed templates to STDOUT rather than to a file
Display a help message
This is an experimental module. New features will be added, such as syncing of multiple files per profile, and the API and configuration file syntax may need to change. So, before we hit version 1.0, make sure to read the Changes file before upgrading.
Changes
Peter Shangov <pshangov at yahoo dot com>
This software is copyright (c) 2010 by Peter Shangov.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install App::Rcsync, copy and paste the appropriate command in to your terminal.
cpanm
cpanm App::Rcsync
CPAN shell
perl -MCPAN -e shell install App::Rcsync
For more information on module installation, please visit the detailed CPAN module installation guide.