Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- #
- # Backup a concrete5 site into 2 archives (excluding the core)
- # A zip for files and a zip for everything else)
- #
- # John Steele - http://www.steelesoftconsulting.com/
- #
- # Change these 3 to reflect your environment:
- DIR=c5dev
- C5="$HOME/c5dev"
- BACKDIR="$HOME/backup"
- mkdir -p $BACKDIR # creates it if it doesn't exist yet
- cd $C5
- NICE="$(which nice)"
- ZIP="$(which zip)"
- DATE=`date +%F` # DATE=`date +%m-%d-%y`
- FARC="$BACKDIR/$DIR"_files_"$DATE".zip
- CARC="$BACKDIR/$DIR"_dir_"$DATE.zip"
- # some cleanup
- rm -f files/cache/tmp/*
- rm -f files/cache/zend_cache*
- rm -f $FARC
- rm -f $CARC
- # create the zip archive of files/ (with exclusions)
- $NICE $ZIP -qyr $FARC files \
- -x "files/cache/*" "files/tmp/*" "files/trash/*" \
- -x "files/backups/*" # you may want to comment this line
- cd ..
- # archive the rest
- $NICE $ZIP -qyr $CARC $DIR \
- -x "$DIR/concrete/*" "$DIR/files/*"
- # optional, change permissions to only owner
- chmod go-rw $FARC $CARC
Advertisement
Add Comment
Please, Sign In to add comment