From 7495d620ca83e27b1dcf6d721b126be3943c6831 Mon Sep 17 00:00:00 2001 From: nacho Date: Tue, 1 Aug 2017 21:19:24 +0200 Subject: [PATCH] nc-backup: small fix --- etc/nextcloudpi-config.d/nc-backup.sh | 9 +++++---- update.sh | 4 ++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/etc/nextcloudpi-config.d/nc-backup.sh b/etc/nextcloudpi-config.d/nc-backup.sh index f9c91e5b4..a7e1e3c86 100644 --- a/etc/nextcloudpi-config.d/nc-backup.sh +++ b/etc/nextcloudpi-config.d/nc-backup.sh @@ -55,10 +55,11 @@ configure() # delete older backups [[ $BACKUPLIMIT_ != 0 ]] && { local NUMBKPS=$( ls $DESTDIR_/nextcloud-bkp_* | wc -l ) - ls -t $DESTDIR_/nextcloud-bkp_* | tail -$(( $NUMBKPS - $BACKUPLIMIT_ )) | while read f; do - echo -e "clean up old backup $f" - rm $f - done + [[ $NUMBKPS > $BACKUPLIMIT_ ]] && \ + ls -t $DESTDIR_/nextcloud-bkp_* | tail -$(( NUMBKPS - $BACKUPLIMIT_ )) | while read f; do + echo -e "clean up old backup $f" + rm $f + done } cd $BASEDIR/nextcloud diff --git a/update.sh b/update.sh index 21e6e03e9..44f3a7163 100755 --- a/update.sh +++ b/update.sh @@ -47,8 +47,8 @@ chmod 660 /usr/local/etc/nextcloudpi-config.d/* # install web interface cp -r ncp-web /var/www/ -chown www-data:www-data /var/www/ncp-web -chmod 770 /var/www/ncp-web +chown -R www-data:www-data /var/www/ncp-web +chmod 770 /var/www/ncp-web ## BACKWARD FIXES ( for older images )