diff --git a/bin/ncp-restore b/bin/ncp-restore index 41987b70..228afc6d 100755 --- a/bin/ncp-restore +++ b/bin/ncp-restore @@ -38,10 +38,7 @@ free=$( df "$TMPDIR" | tail -1 | awk '{ print $4 }' ) # EXTRACT FILES echo "extracting backup file $BACKUPFILE..." -tar $compress_arg -xf "$BACKUPFILE" -C "$TMPDIR" || { - echo "An error occurred. Abort" - exit 1 -} +tar $compress_arg -xf "$BACKUPFILE" -C "$TMPDIR" || exit 1 ## SANITY CHECKS [[ -d "$TMPDIR"/nextcloud ]] && [[ -f "$( ls "$TMPDIR"/nextcloud-sqlbkp_*.bak 2>/dev/null )" ]] || { @@ -189,5 +186,3 @@ ncc files:scan-app-data clear_opcache bash -c "sleep 3; service php${PHPVER}-fpm restart" &>/dev/null & } - -} diff --git a/etc/library.sh b/etc/library.sh index 8e4de6bd..cc330404 100644 --- a/etc/library.sh +++ b/etc/library.sh @@ -596,6 +596,14 @@ function get_nc_config_value() { } function clear_opcache() { + # shellcheck disable=SC2155 + local data_dir="$(get_nc_config_value datadirectory)" + ! [[ -d "${data_dir:-/var/www/data}/.opcache" ]] || { + echo "Clearing opcache..." + echo "This can take some time. Please don't interrupt the process/close your browser tab." + rm -rf "${data_dir:-/var/www/data}/.opcache"/* + echo "Done." + } service php${PHPVER}-fpm reload }