This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
user:asowers:rsync_-_for_a_better_cloud [2012/05/01 16:02] – [The Script] asowers | user:asowers:rsync_-_for_a_better_cloud [2012/05/02 17:08] (current) – [The new script] asowers | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====Guten Tag==== | ||
+ | ====Project V: RSYNC and Unison, the personal cloud strikes back.==== | ||
+ | |||
+ | So with all this talk of redundant, synchronous, | ||
+ | |||
+ | ====How would one accomplish such a task?==== | ||
+ | So, call me crazy, I think it may be possible to not rely on a third party service for internet based data storage!?! Nuts right? after arguing on some forums with folks @ http:// | ||
+ | |||
+ | Let's begin... | ||
+ | |||
+ | ====Materials==== | ||
+ | |||
+ | - My PogoPlug with Arch Linux will serve my purpose well here. | ||
+ | - A script that will make an autonomes, bidirectional, | ||
+ | - Devices to sync with; Laptop, Smartphone, Work-PC. | ||
+ | |||
+ | |||
+ | ====The Script==== | ||
+ | So here is a script I've modified to fit my needs: | ||
+ | < | ||
+ | #!/bin/sh | ||
+ | |||
+ | set -u | ||
+ | set -x | ||
+ | |||
+ | HOST=andrew@67.241.242.136 | ||
+ | SRC=/ | ||
+ | DST=/ | ||
+ | |||
+ | if ssh " | ||
+ | ssh " | ||
+ | ssh " | ||
+ | ssh " | ||
+ | ssh " | ||
+ | fi | ||
+ | |||
+ | rsync --progress --archive --delete -F --rsh=ssh --link-dest=../ | ||
+ | " | ||
+ | ssh " | ||
+ | </ | ||
+ | |||
+ | The script will make backups of the / | ||
+ | |||
+ | ====The new script==== | ||
+ | |||
+ | So After careful consideration, | ||
+ | |||
+ | Here is the script that synchronizes my two folders: | ||
+ | < | ||
+ | #!/bin/bash | ||
+ | _paths="/ | ||
+ | _unison=/ | ||
+ | _rserver=" | ||
+ | for r in ${_rserver} | ||
+ | do | ||
+ | for p in ${_paths} | ||
+ | do | ||
+ | ${_unison} -batch / | ||
+ | done | ||
+ | done | ||
+ | </ | ||
+ | Running this script every time I want to backup would be inconvenient, |