This is a great idea, but it violates my personal backup principle: make the backup site connect to the server. If the server has the necessary information to connect to the backup site and initiate the process, it most likely has the ability to connect to the backup site and destroy backup information in case of intrusions or security vulnerabilities. If the server never knows anything about the backup site (other than their public key), then even if the server is compromised, the backups should remain safe and secure.
This is true in the case of backup software specifically, but it looks like lsyncd is intended more for push-type situations like moving content from a private to a public network, mirroring sites, feeding CDN's and so on. In those cases you do want the source to control the operation.
The tool clearly states in which situations it should be used or not used but I'm pretty certain that overtime it will be misused.
If you want real-time mirroring of your data, I HIGHLY recommend that you use http://www.drbd.org instead. Lsyncd is great if you just have a select few folders with small files that change often (or large files that rarely change).
while true; do inotifywait -r --exclude '^\..*\.swp$' -e CLOSE_WRITE src_dir; sleep 1; rsync -a src_dir/ dst_host:dst_dir/;done
This version has a race condition, but is sufficient for pushing a source tree into a testing environment automatically during development. You could also use the -m switch to inotifywait and a while loop on the output to avoid the race.
I wouldn't want to use anything apart from manual deployment script to deploy to CDNs since a daemon adds another point of failure. To check for a failure you'd need to check that the daemon has done its job, at which point you'd be running a script to do this and so could just use rsync at that point instead.
5 comments
[ 5.4 ms ] story [ 19.8 ms ] threadIf you want real-time mirroring of your data, I HIGHLY recommend that you use http://www.drbd.org instead. Lsyncd is great if you just have a select few folders with small files that change often (or large files that rarely change).
while true; do inotifywait -r --exclude '^\..*\.swp$' -e CLOSE_WRITE src_dir; sleep 1; rsync -a src_dir/ dst_host:dst_dir/;done
This version has a race condition, but is sufficient for pushing a source tree into a testing environment automatically during development. You could also use the -m switch to inotifywait and a while loop on the output to avoid the race.
I wouldn't want to use anything apart from manual deployment script to deploy to CDNs since a daemon adds another point of failure. To check for a failure you'd need to check that the daemon has done its job, at which point you'd be running a script to do this and so could just use rsync at that point instead.