#!/bin/bash # corzblog update script # # takes a snap-shot backup of my current /blog/ code # then uploads the latest code to corz.org/blog/.. # # this runs when I have made everything sweet, and want it live. # it can get used a lot in one session, manually from the shell. # # [note: content & code is backed-up separately, every night] # # this script has been refined over time, # so you may find it a useful automatic ftp example. # # For a more comprehensive (and secure) website sync, see here.. # http://corz.org/public/machine/source/php/website-sync-linux.php # # ;o) # (or # # 2003-> (or @ corz.org ;o) # # prefs.. HOST="domain.org" USER="UserName" PASSWD="MyPassW0rd" # the location of your development mirror, as seen by the file system.. LOCAL="/home/MyFolder" # the location of your live web root, as seen by the ftp server.. REMOTE="/public_html" # where to dump the backups.. BAX="/bax/www" # end prefs. # the backup file name will be date-coded.. NOW=`date "+%Y.%m.%d-%H.%M"` echo echo "corzblog update script.." # backup.. echo echo "archiving old blog folders.." mkdir $BAX/cb cp -R $LOCAL/blog/* $BAX/cb # remove unwanted files from the code backup, save bloat. rm -rf $BAX/cb/arc $BAX/cb/img $BAX/cb/audio $BAX/cb/inc/spelling/*.list $BAX/cb/inc/*.zip # zip the backup and move to the backup folder. cd $BAX/ tar cfz corzblog-bax-$NOW.tar.gz cb > /dev/null mv corzblog-bax* $BAX/_arc/blog/ rm -rf $BAX/cb echo echo "performing ftp operations.." # -i so we don't get bugged with questions ftp -i -n $HOST <