diff options
-rw-r--r-- | changelog.md | 14 | ||||
-rw-r--r-- | etc/nextcloudpi-config.d/nc-backup-auto.sh | 31 | ||||
-rw-r--r-- | etc/nextcloudpi-config.d/nc-backup.sh | 24 |
3 files changed, 51 insertions, 18 deletions
diff --git a/changelog.md b/changelog.md index ab019cab..6d44da3a 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,17 @@ -[v0.26.22](https://github.com/nextcloud/nextcloudpi/commit/e38f24c) (2017-09-08) build devel: deactivate unattended upgrades +[v0.26.28](https://github.com/nextcloud/nextcloudpi/commit/94eb3ce) (2017-09-08) nc-backup: small fixes + +[v0.26.27](https://github.com/nextcloud/nextcloudpi/commit/649e8b7) (2017-09-10) ncp-web: link to wiki info for each extra + +[v0.26.26](https://github.com/nextcloud/nextcloudpi/commit/6f25713) (2017-09-10) ncp-web: minor tweaks + +[v0.26.25](https://github.com/nextcloud/nextcloudpi/commit/fab1815) (2017-09-10) ncp-web: click version for changelog. click new version notification to nc-update + +[v0.26.24](https://github.com/nextcloud/nextcloudpi/commit/ea5bbb4) (2017-09-10) nc-format-USB: silent mkfs output + +[v0.26.23](https://github.com/nextcloud/nextcloudpi/commit/e820243) (2017-09-10) ncp-web: display info for each option + +[v0.26.22](https://github.com/nextcloud/nextcloudpi/commit/a20243e) (2017-09-09) nc-format-USB: adjust to the new automount system [v0.26.21](https://github.com/nextcloud/nextcloudpi/commit/64e878d) (2017-09-08) tag images diff --git a/etc/nextcloudpi-config.d/nc-backup-auto.sh b/etc/nextcloudpi-config.d/nc-backup-auto.sh index f016b5d1..6e3ff7fd 100644 --- a/etc/nextcloudpi-config.d/nc-backup-auto.sh +++ b/etc/nextcloudpi-config.d/nc-backup-auto.sh @@ -67,15 +67,28 @@ mysqldump -u root --single-transaction nextcloud > \$DBBACKUP [[ "$INCLUDEDATA_" == "yes" ]] && echo -e "backup datadir... " echo -e "backup files..." mkdir -p $DESTDIR_ -tar -cf \$DESTFILE \$DBBACKUP nextcloud/ --exclude 'nextcloud/data/*/files/*' && \ - echo -e "backup \$DESTFILE generated" || \ - echo -e "error generating backup" -rm \$DBBACKUP - -[[ "$INCLUDEDATA_" == "yes" ]] && { - tar -rf \$DESTFILE -C \$DATADIR/.. \$( basename \$DATADIR ) || \ - echo -e "error generating data backup" -} +tar -cf "\$DESTFILE" "\$DBBACKUP" nextcloud/ \ + --exclude "nextcloud/data/*/files/*" \ + --exclude "nextcloud/data/.opcache" \ + --exclude "nextcloud/data/{access,error,nextcloud}.log" \ + --exclude "nextcloud/data/access.log" \ + || { + echo -e "error generating backup" + sudo -u www-data php "$BASEDIR"/nextcloud/occ maintenance:mode --off + return 1 + } + rm "\$DBBACKUP" + + [[ "$INCLUDEDATA_" == "yes" ]] && { + echo -e "backup data files..." + tar -rf "\$DESTFILE" -C "\$DATADIR"/.. "\$( basename "\$DATADIR" )" \ + || { + echo -e "error generating backup" + sudo -u www-data php "$BASEDIR"/nextcloud/occ maintenance:mode --off + return 1 + } + } + echo -e "backup \$DESTFILE generated" # delete older backups [[ $BACKUPLIMIT_ != 0 ]] && { diff --git a/etc/nextcloudpi-config.d/nc-backup.sh b/etc/nextcloudpi-config.d/nc-backup.sh index e75648b5..528f4f21 100644 --- a/etc/nextcloudpi-config.d/nc-backup.sh +++ b/etc/nextcloudpi-config.d/nc-backup.sh @@ -37,22 +37,30 @@ configure() echo -e "backup database..." mysqldump -u root --single-transaction nextcloud > "$DBBACKUP" - [[ "$INCLUDEDATA_" == "yes" ]] && echo -e "backup datadir... " - echo -e "backup files..." + echo -e "backup base files..." mkdir -p "$DESTDIR_" tar -cf "$DESTFILE" "$DBBACKUP" nextcloud/ \ --exclude "nextcloud/data/*/files/*" \ --exclude "nextcloud/data/.opcache" \ --exclude "nextcloud/data/{access,error,nextcloud}.log" \ - && \ - echo -e "backup $DESTFILE generated" || \ - echo -e "error generating backup" + --exclude "nextcloud/data/access.log" \ + || { + echo -e "error generating backup" + sudo -u www-data php "$BASEDIR"/nextcloud/occ maintenance:mode --off + return 1 + } rm "$DBBACKUP" [[ "$INCLUDEDATA_" == "yes" ]] && { - tar -rf "$DESTFILE" -C "$DATADIR"/.. "$( basename "$DATADIR" )" || \ - echo -e "error generating data backup" - } + echo -e "backup data files..." + tar -rf "$DESTFILE" -C "$DATADIR"/.. "$( basename "$DATADIR" )" \ + || { + echo -e "error generating backup" + sudo -u www-data php "$BASEDIR"/nextcloud/occ maintenance:mode --off + return 1 + } + } + echo -e "backup $DESTFILE generated" # delete older backups [[ $BACKUPLIMIT_ != 0 ]] && { |