Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I using my Dropbox to sync my config files on different machines. In addition my Dropbox is synced with encfs. encfs mounts a volume with the decrypted Dropbox-folder on startup. This process takes a while. This is not a problem for config files like .vimrc or .bashrc or something because I am not using this programs directly during startup. I just use a simple

cd && ln -s DecryptedDropbox/.vimrc

to link them. And .vimrc is available as soon as the decrypted Dropbox is mounted.

However, I use some config files which are important for the startup process like config files for my windowmanager i.e. .i3/.

Would it be possible to local version of .i3 on my hard drive that syncs with Dropbox as soon as it is available? Of course I also want the Dropbox version changed if I change the local version. I think hard links would not work here since there not really to copys of my file, right? Any other ideas? rsync?

share|improve this question
So, your problem is that Dropbox isn't starting up soon enough and sync'ing your config files soon enough? (soon enough for your window manager?) – dtmland Jul 9 '13 at 18:34
up vote 1 down vote accepted

Files in the dropbox folder are real files. You should be able to hard link them, but it might not be the best way of doing things. If the files are very small then a simple cron script to copy them once every few minutes might be the simplest and most robust solution here.

share|improve this answer
Last I checked, Dropbox's file-change algorithm didn't notice changes to files that are hard linked both in and out of the Dropbox directory. – killermist Jul 15 '13 at 23:30

A few options:

  1. Keeping Dropbox: The easiest solution would be to keep these files in a non-encrypted part of your Dropbox, I assume there is no reason to have your WM config files encrypted. You can then just do a simple soft link as you describe for .vimrc. If it is the encryption that is causing you problems, that should fix it.

    If you are committed to using Dropbox and can't have any part of it unencrypted, I don't see how you could combine it with rsync. As far as I know Dropbox does not offer any ssh or other access, only its own client.

  2. Ditching Dropbox: If, on the other hand, you don't need to use Dropbox but just want to copy certain configuration files from a remote server only if those files are newer than the local copies, yes you can use rsync. If you have passwordless ssh access set up between the server and the local machine, you should be able to copy the relevant files with this command:

    rsync -uza .ie3/

    Note the slash at the end of each directory, that tells rsync to copy the directories' content and not the folders themselves. This is so you don't end up with a local ~/.ie3/.ie3/.

    From man rsync:

    -u, --update
      This  forces  rsync to skip any files which exist on the destination and
      have a modified time that is newer than the source file.  (If an existing
      destination file has a modification  time  equal  to  the source file’s, 
      it will be updated if the sizes are different.)
    -z, --compress
      With  this  option,  rsync  compresses the file data as it is sent to the 
      destination machine, which reduces the amount of data being transmitted --
      something that is useful over a slow connection.
    -a, --archive <- this preserves mod. times, permissions etc.
      This is equivalent to -rlptgoD. It is a quick way of saying you want 
      recursion and want to preserve almost everything.
share|improve this answer

Are these config files really required to be encrypted? I don't see what a .vimrc could hold as secret.

Also, I don't think DropBox is the best solution for cloud storing config files. They don't change too often, and DropBox doesn't provide proper compare and merge features and only store older versions for 1 month.

I use Subversion for that. I have a Subversion project where I store many config files: Classic Shell, gtkrc, WinPatrol, FireFox profiles.ini, Sandboxie.ini, vimrc, etc etc.

Since these files aren't changed often and are plain text files, Subversion handles them nicely. WinMerge offers a great GUI for comparing versions so that I can see what changed.

Some files can be stored live, as mpc-hc.ini. Others sadly I need to manually copy when I change them.

For cloud storage I use

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .