You are not logged in.

#1 2012-07-12 20:53:14

hesse
Member
Registered: 2011-12-08
Posts: 88

Environment synchronization between Linux boxes

After making some changes to my shell config or X resource files, I often find myself having to synchronize them to my different computers. I'm a simple guy and I like to work in the same environment (e.g. aliases and scripts + terminal colors and font) wherever I choose to work. So far I've just used a hosted git repo to push and pull these files from. The steps would be something like this:

1. Modify a config file
2. Commit and push the changes in the repo tracking the file
3. ssh to the other box and pull in the changes
4. vimdiff the changes and apply changes

This solution works ok but makes me wonder if there's a simpler way to do this. How do you sync your enviroments? What tools are you using?
Thanks

Last edited by hesse (2012-07-12 21:38:10)

Offline

#2 2012-07-12 21:33:43

firecat53
Member
From: Lake Stevens, WA, USA
Registered: 2007-05-14
Posts: 1,542
Website

Re: Environment synchronization between Linux boxes

1. Scripts - stored in ~/.local/src/scripts.git. Synced with central git repo on my server as needed. Scripts only used on a particular computer are symlinked into ~/.local/bin

2. Dotfiles - synced with unison using a bash script, cronjob and different profile files: (I sync my mail, media and documents this way, too)

$ ls .unison
default.prf
desktop.prf
dotfiles.prf
homeserver.prf
laptop.prf
mail.prf
unison.log

For example - default.prf

# Common Unison preferences file

# Files
path = .unison/default.prf
path = .unison/dotfiles.prf
path = .unison/laptop.prf
path = .unison/desktop.prf
path = .unison/homeserver.prf
path = .unison/mail.prf
path = .unison/usapparel.prf
path = .weather

# Ignores
ignore = Name .*~
ignore = Name *.swp
ignore = Name *.pyc
ignore = Name *.pyo

## Miscellaneous settings
confirmbigdeletes = true
perms = -1
owner = true
group = true
times = true
prefer = newer
sortbysize = true
sortnewfirst = true
maxthreads = 50
rshargs = -C
log = true

dotfiles.prf:

## $HOME Dotfiles to sync with Unison

# Directories
path = .colors
path = .config/dwb
path = .config/feh
path = .config/gtk-3.0
path = .config/keepassx
path = .config/mopidy
path = .config/mpd
path = .config/pianobar
path = .config/ranger
path = .config/tmux
path = .config/zathura
path = .fonts
path = .gnupg
path = .ICAClient
path = .local/share/mpd/playlists
path = .texlive
path = .themes
path = .vim
path = .weechat

# Files
path = .abcde.conf
path = .bashrc
path = .bashrc.gui
path = .config/user-dirs.dirs
path = .credentials
path = .dmenurc
path = .fehrc
path = .gitconfig
path = .gitignore
path = .gtkrc-2.0
path = .inputrc
path = .lftp/bookmarks
path = .lftprc
path = .local/share/mpd/mpd.db
path = .my.cnf
path = .ncmpcpp/config
path = .ncmpcpp/keys
path = .pentadactylrc
path = .smbpasswd
path = .Xdefaults
path = .xinitrc

ignore = Path .config/dwb/dwb-uni.fifo
ignore = Path .config/pianobar/ctl
ignore = Path .config/pianobar/nowplaying
ignore = Path .config/ranger/bookmarks
ignore = Path .gnupg/gpg-agent.env
ignore = Path .vim/view
ignore = Path .weechat/logs
ignore = Path .weechat/weechat.log
ignore = Path .weechat/weechat_fifo*

The trick with syncing dotfiles like this via unison is making sure that any platform specific configurations are handled...for example I've got some if/then switches in .bashrc to set certain variables depending on whether it's for the laptop or the server.

I've been pretty happy with this setup for the past several months.

Scott

Offline

#3 2012-07-13 02:25:48

defears
Member
Registered: 2010-07-26
Posts: 218

Re: Environment synchronization between Linux boxes

Dropbox with 3 folders full of symlinks from a Thunar custom action.

Dropbox/Config/Local
Dropbox/Config/Global
Dropbox/Config/Scripts

No interaction required. But if you use Dropbox, I suggest to encrypt the whole Dropbox folder with Encfs.

Offline

#4 2012-07-13 04:25:08

Xyne
Administrator/PM
Registered: 2008-08-03
Posts: 6,963
Website

Re: Environment synchronization between Linux boxes

You could use unison. It's simple and requires no third party.


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#5 2012-07-13 15:45:42

hesse
Member
Registered: 2011-12-08
Posts: 88

Re: Environment synchronization between Linux boxes

Sounds like unison is a good tool for this kind job. I will definitely try this tool and see what happens. Noticed that it's cross-platform (Windows + UNIX) which is most appealing. Any other suggestions or comments?

Offline

#6 2012-07-13 18:01:10

FreeTheBee
Member
Registered: 2011-01-02
Posts: 125

Re: Environment synchronization between Linux boxes

Similar to defears, I have a dotfiles folder on an encfs encrypted dropbox where I store some config files.

Offline

Board footer

Powered by FluxBB