Backup script

This commit is contained in:
Kai Hendry
2015-10-10 16:59:38 +08:00
parent b750aa30f3
commit 28fcec43f2
3 changed files with 32 additions and 8 deletions

View File

@@ -0,0 +1,8 @@
#!/bin/bash -ex
cd "${BASH_SOURCE%/*}" || exit 1
bundleDir=$PWD
wwwdir=/srv/www/backup.greptweet.com
cd /mnt/2tb/greptweet || exit 1
rsync -trvi --exclude 'tweets.txt.gz' --include '*/' --include '*.txt.gz' --exclude '*' --prune-empty-dirs core:/srv/www/greptweet.com/ . &> $wwwdir/rsync.log
find -name '*.gz' -type f -print0 | tar cf $wwwdir/tweets.tar --null -T -
$bundleDir/index.sh $wwwdir > $wwwdir/index.html