real time backup if file changed?
If you want to keep two replicas of a directory tree on two different filesystems, then ChironFS might be the solution. It's a FUSE-based filesystem, that replicates any changes to its "virtual" filesystem to two other "real" filesystems.
Installation and usage instructions are available here: http://www.furquim.org/chironfs/howto.html
You could probably hack this together using inotify
and more specifically incron
to get notifications of file system events and trigger a backup.
Meanwhile, in order to find a more specific solution you might try to better define your problem.
- If your problem is backup, it might be good to use a tool that is made to create snapshots of file systems, either through
rsnap
or a snapshoting file system likexfs
or using any file system withlvm
. - If your problem is sycronizing, perhaps you should look into distributed and/or netowrk file systems.
Edit: In light of your update, I think you are making this way to complicated. Just make a folder in your dropbox for scripts. Then in your bashrc files do something like this:
export PATH=$PATH:~/Dropbox/bin
source ~/Dropbox/bashrc
Whatever scripts you have can be run right from the dropbox folder in your home directory, and any aliases and such you want synced can go in a file inside Dropbox that gets sourced by your shell.
If other people besides you need access to the scripts, you could symlink them from your Dropbox to somewhere like /usr/local/bin.