#!/bin/bash echo echo Preparing update pack... echo prev_rev=1 rep_name={projectName} rep_path=trunk rep_host=http://svn.fr-wd.com upload_path=___SET___ upload_host=___SET___ upload_user=___SET___ upload_pass=___SET___ curr_rev=$(svn info $rep_host/$rep_name/$rep_path | grep Revision | awk '{print $2}') echo Current revision: $curr_rev echo site_rev=$(wget -qO- ftp://$upload_user:$upload_pass@$upload_host/$upload_path/rev) if [ $? -eq 0 ] then prev_rev=$site_rev echo Remote revision: $site_rev else echo unable to get remote revision echo using HARD CODED value : $prev_rev fi echo echo press Enter to continue read echo previous: $prev_rev, current: $curr_rev rm -Rf $rep_name svn_changed -r$prev_rev:$curr_rev $rep_name/$rep_path curr_dir=$(pwd) cd $rep_name/trunk mkdir www echo $curr_rev>www/rev d=$curr_rev-$prev_rev-$(date +%y%m%d%H%M) mysqldump -udev -pdevpass -hlocalhost {dbName} >{dbName}_db.sql # echo "# we should update manually">{dbName}_db.sql res_file=$d.tar.bz2 tar -cjf $res_file www site {dbName}_db.sql mv $res_file $curr_dir/$res_file cd $curr_dir rm -Rf $rep_name echo Finished echo echo File $res_file prepared echo echo UPLOADING TO REMOTE SERVER echo echo press Enter to continue read curl -T "$res_file" ftp://$upload_user:$upload_pass@$upload_host/ echo echo DO NOT FORGET TO MANUALLY EXTRACT FILE ON THE SERVER