Skip to content

Instantly share code, notes, and snippets.

@alessandro-fazzi
Last active December 14, 2015 12:19
Show Gist options
  • Save alessandro-fazzi/5085751 to your computer and use it in GitHub Desktop.
Save alessandro-fazzi/5085751 to your computer and use it in GitHub Desktop.
Clone the gist anyway you like in you MediaTemple GridServer and execute it with bash mt_gs_rdiff-backup_installer.sh No params, no questions, just straight. It will install rdiff-backup on your GS instance, enabling you to do remote backups using rdiff-backup. If you have questions or a beer for us twit us @welaika and @Pioneer_Skies
#!/bin/bash
# Clone the gist anyway you like in you MediaTemple GridServer and execute it with
# bash mt_gs_rdiff-backup_installer.sh
# No params, no questions, just straight. Logout and log back after script's ended
# Credits to @weliaka: https://github.com/welaika http://welaika.com http://pisadmin.welaika.com
# Also follow ups on this article are welcome:
# http://pisadmin.welaika.com/post/44637112969/our-definitive-mt-grid-service-backup-solution
cd ~/data/tmp
wget http://savannah.nongnu.org/download/rdiff-backup/rdiff-backup-1.2.8.tar.gz
wget http://downloads.sourceforge.net/librsync/librsync-0.9.7.tar.gz
tar xvzf rdiff-backup-1.2.8.tar.gz
tar xvzf librsync-0.9.7.tar.gz
rm *.gz
export CFLAGS="$CFLAGS -fPIC"
export CXXFLAGS="$CFLAGS"
MT_NUMBER=`dirname ~ | sed -e "s/\/home\/\([0-9]\+\)\/.*/\1/;" | tr -d \'\n\'`
PREFIX=/home/$MT_NUMBER/data/local
export PATH=$PREFIX/bin:$PATH
export LIBRSYNC_DIR=$PREFIX
export PYTHONPATH=$PREFIX/lib/python2.6/site-packages:$PYTHONPATH
cd librsync-0.9.7
./configure --prefix=$PREFIX
make
make install
cd ../rdiff-backup-1.2.8
python setup.py --librsync-dir=$PREFIX build
python setup.py install --prefix=$PREFIX
cd ~
[[ `grep PYTHONPATH .bashrc` ]] || (
sed -i '3 i\
\
## MyLOCAL bin PATH\
MT_NUMBER=`dirname ~ | sed -e "s/\\/home\\/\\([0-9]\\+\\)\\/.*/\\1/;" | tr -d \"\\n\"`\
export PATH="$PATH:/home/${MT_NUMBER}/data/local/bin"\
export PYTHONPATH="/home/${MT_NUMBER}/data/local/lib/python2.6/site-packages"\
' .bashrc
)
source .bashrc
if [[ `which rdiff-backup` ]]; then
echo 'Seems to work, dear sir'
exit 0
else
echo 'Sgrunt! Something is wrong here!'
exit 1
fi
@alessandro-fazzi
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment