diff options
author | Daniel Hansson <github@hanssonit.se> | 2018-09-27 21:27:55 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-27 21:27:55 +0300 |
commit | 69b05062abd208d080a8d9cea7b610bd78fb0f5c (patch) | |
tree | 7898eeeac9bb704c5d001a37fd757538a1dca4cb /nextcloud_update.sh | |
parent | e2238ae0d2f426240e11acff51974a29fb13318c (diff) |
move NCBACKUP to /mnt (#666)
* move NCBACKUP to /mnt
but check for /var for backwards compability
Diffstat (limited to 'nextcloud_update.sh')
-rw-r--r-- | nextcloud_update.sh | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/nextcloud_update.sh b/nextcloud_update.sh index 8a83f096..4947d3af 100644 --- a/nextcloud_update.sh +++ b/nextcloud_update.sh @@ -166,8 +166,13 @@ sleep 10 # Stop Apache2 check_command service apache2 stop -# Create backup dir (/var/NCBACKUP/) -mkdir -p "$BACKUP" +# Create backup dir (/mnt/NCBACKUP/) +if [ ! -d "$BACKUP" ] +then + BACKUP=/var/NCBACKUP + mkdir -p $BACKUP +fi + # Backup PostgreSQL if which psql > /dev/null @@ -235,8 +240,8 @@ echo "Backing up data..." DATE=$(date +%Y-%m-%d-%H%M%S) if [ -d $BACKUP ] then - mkdir -p "/var/NCBACKUP_OLD/$DATE" - mv $BACKUP/* "/var/NCBACKUP_OLD/$DATE" + mkdir -p "$BACKUP-OLD/$DATE" + mv $BACKUP/* "$BACKUP-OLD/$DATE" rm -R $BACKUP mkdir -p $BACKUP fi |