diff --git a/README.md b/README.md index feebd86..1552ea2 100644 --- a/README.md +++ b/README.md @@ -126,7 +126,9 @@ ``` ./backup.sh backup all ``` -**Plese check if `COMPOSE_PROJECT_NAME` exists in your local `gitbucket.conf`!!!** + +- **Plese check if `COMPOSE_PROJECT_NAME` exists in your local `gitbucket.conf`!!!** +- **You have to be install the pbzip2 package!** For debian systems: `apt-get install pbzip2` #### Full Backup via `backup.sh` For backuping the mysql database and the repositories you could use the `backup.sh` script and combine it with a daily cronjob. diff --git a/backup.sh b/backup.sh index 481044e..2fc7344 100755 --- a/backup.sh +++ b/backup.sh @@ -61,8 +61,9 @@ repos|all) echo "backup repositories" - repoFile="${backupDir}/repositories/${currentDate}.tbz2" - tar -cj data/repositories -f ${repoFile} + dstFile="${backupDir}/repositories/${currentDate}.tbz2" + #tar -cj data/repositories -f ${repoFile} + tar -I pbzip2 -c data/repositories -f ${dstFile} # copy auto backup folder if [ -d "data/backup" ]; then @@ -80,8 +81,8 @@ if [ -d "data/gist" ]; then echo "backup gist directory" - repoFile="${backupDir}/gist/${currentDate}.tbz2" - tar -cj data/gist -f ${repoFile} + dstFile="${backupDir}/gist/${currentDate}.tbz2" + tar -cj data/gist -f ${dstFile} fi ;;& @@ -89,8 +90,8 @@ if [ -d "data/data" ]; then echo "backup data directory" - repoFile="${backupDir}/data/${currentDate}.tbz2" - tar -cj data/data -f ${repoFile} + dstFile="${backupDir}/data/${currentDate}.tbz2" + tar -cj data/data -f ${dstFile} fi ;;& @@ -104,8 +105,8 @@ shift done - # delete all files older 10 days - #find ${backupDir} -iname "*.tbz2" -type f -mtime +10 -exec rm {} \; > /dev/null + # delete all files older 30 days + find ${backupDir} -iname "*.tbz2" -type f -mtime +30 -exec rm -i {} \; > /dev/null } function restore() {