Backup of bitbucket.

This commit is contained in:
2014-11-10 10:51:32 +04:00
parent 37e0c14ef0
commit 5927117332

View File

@@ -2,6 +2,7 @@ CD=cd
DATE=/bin/date
TAR=/bin/tar
BZIP2=/bin/bzip2
GIT=/usr/bin/git
GPG=/usr/bin/gpg
PASS=/home/vahagn/.gnupg/backup-passphrase
SRC=/home/vahagn/git
@@ -26,10 +27,17 @@ SIGNATURE=$BACKUP_DIR/git.$TIMESTAMP.tar.bz2.sig
echo Starting $LOG | tee -a $LOG
echo start `$DATE` | tee -a $LOG
#
# Sync with BitBucket upstream repos.
#
$CD $SRC/scripts.git
$GIT fetch
$CD $SRC/test.git
$GIT fetch
#
# cd to git directory and then bzip2 all content and crypt it.
#
$CD $SRC
($TAR -cvp . | $BZIP2 -c | $GPG -c --passphrase-file $PASS --output $BACKUP) 2>&1| tee -a $LOG
($TAR -cvp . | $BZIP2 -c | $GPG -c --passphrase-file $PASS --output $BACKUP --batch --quiet ) 2>&1| tee -a $LOG
#
# Remove old files
#