diff --git a/backup.sh b/backup.sh index 3850d8b..7721b8e 100755 --- a/backup.sh +++ b/backup.sh @@ -2,7 +2,10 @@ # backup directory -backupDir=$PWD/backup +SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +backupDir=${SCRIPT_DIR}/backup + +# create directories mkdir -p ${backupDir}/app mkdir -p ${backupDir}/docker-conf mkdir -p ${backupDir}/data @@ -18,10 +21,10 @@ tar -cj ${dbFile} -f "${dbFile}.tbz2" rm ${dbFile} -# backup app data as root because of permissions +# backup app data as root because of permission problems sudo tar -C data -I pbzip2 -pc app -f "${backupDir}/app/${currentDate}.tbz2" -# backup data as root because of permissions +# backup data as root because of permission problems #sudo tar -C data -I pbzip2 -pc data -f "${backupDir}/data/${currentDate}.tbz2" # backup config files