diff options
author | nachoparker <nacho@ownyourbits.com> | 2021-11-05 22:12:30 +0300 |
---|---|---|
committer | nachoparker <nacho@ownyourbits.com> | 2021-11-05 22:38:00 +0300 |
commit | 6aba9b92a6ee0cc2c8fbaf9835803ce623ca30f1 (patch) | |
tree | c3d52bdeb3f38ba60a131b0ba6a03b1289c63d9f | |
parent | c56a4db369a1c6238bc52a23287e590e5590d7a5 (diff) |
nc-restore: improve restoring data from SD to dockerv1.43.7
Signed-off-by: nachoparker <nacho@ownyourbits.com>
-rw-r--r-- | bin/ncp/BACKUPS/nc-restore.sh | 9 | ||||
-rw-r--r-- | changelog.md | 10 | ||||
-rw-r--r-- | updates/1.43.0.sh (renamed from updates/1.42.0.sh) | 3 |
3 files changed, 17 insertions, 5 deletions
diff --git a/bin/ncp/BACKUPS/nc-restore.sh b/bin/ncp/BACKUPS/nc-restore.sh index 95e68ba5..19deef5f 100644 --- a/bin/ncp/BACKUPS/nc-restore.sh +++ b/bin/ncp/BACKUPS/nc-restore.sh @@ -93,7 +93,11 @@ mysql -u root nextcloud < "$TMPDIR"/nextcloud-sqlbkp_*.bak || { echo "Error res ## RESTORE DATADIR -DATADIR=$( grep datadirectory "$NCDIR"/config/config.php | awk '{ print $3 }' | grep -oP "[^']*[^']" | head -1 ) +if is_docker; then + DATADIR=/data/nextcloud/data +else + DATADIR="$(grep datadirectory "$NCDIR"/config/config.php | awk '{ print $3 }' | grep -oP "[^']*[^']" | head -1)" +fi [[ "$DATADIR" == "" ]] && { echo "Error reading data directory"; exit 1; } cd "$NCDIR" @@ -133,7 +137,6 @@ else mkdir -p "${DATADIR}" touch "${DATADIR}"/.ocdata chown -R www-data: "${DATADIR}" - sed -i "s|'datadirectory' =>.*|'datadirectory' => '${DATADIR}',|" "$NCDIR"/config/config.php } ncc maintenance:mode --off @@ -143,6 +146,8 @@ else NEED_RESTART=1 fi +sed -i "s|'datadirectory' =>.*|'datadirectory' => '${DATADIR}',|" "${NCDIR}"/config/config.php + # Just in case we moved the opcache dir sed -i "s|^opcache.file_cache=.*|opcache.file_cache=$DATADIR/.opcache|" /etc/php/${PHPVER}/mods-available/opcache.ini diff --git a/changelog.md b/changelog.md index f5971472..634510aa 100644 --- a/changelog.md +++ b/changelog.md @@ -1,9 +1,13 @@ -[v1.43.5](https://github.com/nextcloud/nextcloudpi/commit/93fd384) (2021-11-04) ncp-web: tweak invalid character set +[v1.43.7](https://github.com/nextcloud/nextcloudpi/commit/4a07b5d) (2021-11-05) nc-restore: improve restoring data from SD to docker -[v1.43.4](https://github.com/nextcloud/nextcloudpi/commit/d4bca07) (2021-11-04) nc-restore: Adding ZFS to filesystem whitelist / updating error message +[v1.43.6 ](https://github.com/nextcloud/nextcloudpi/commit/c56a4db) (2021-11-05) ncp-web: hide power menu on docker -[v1.43.3](https://github.com/nextcloud/nextcloudpi/commit/19ede8a) (2021-11-02) nc-datadir: support for nc-encrypted folders +[v1.43.5](https://github.com/nextcloud/nextcloudpi/commit/13f69cd) (2021-11-04) ncp-web: tweak invalid character set + +[v1.43.4 ](https://github.com/nextcloud/nextcloudpi/commit/d4bca07) (2021-11-04) nc-restore: Adding ZFS to filesystem whitelist / updating error message + +[v1.43.3 ](https://github.com/nextcloud/nextcloudpi/commit/19ede8a) (2021-11-02) nc-datadir: support for nc-encrypted folders [v1.43.2 ](https://github.com/nextcloud/nextcloudpi/commit/ee01a70) (2021-10-27) ncp-web: tweak password suggestions diff --git a/updates/1.42.0.sh b/updates/1.43.0.sh index 3471d852..e1bb95dd 100644 --- a/updates/1.42.0.sh +++ b/updates/1.43.0.sh @@ -23,6 +23,9 @@ if ! is_active_app letsencrypt; then fi fi +# update nc-restore +install_app nc-restore + # docker images only [[ -f /.docker-image ]] && { : |