From c8ee5706439ec007520163164ded2dcd26d42730 Mon Sep 17 00:00:00 2001 From: nachoparker Date: Thu, 25 May 2017 09:01:48 +0200 Subject: [PATCH] improvements for nc-backup and nc-restore --- etc/nextcloudpi-config.d/nc-backup.sh | 6 ++++-- etc/nextcloudpi-config.d/nc-restore.sh | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/etc/nextcloudpi-config.d/nc-backup.sh b/etc/nextcloudpi-config.d/nc-backup.sh index a8ef32911..b097c9c95 100644 --- a/etc/nextcloudpi-config.d/nc-backup.sh +++ b/etc/nextcloudpi-config.d/nc-backup.sh @@ -18,6 +18,7 @@ DESTDIR_=/media/USBdrive BASEDIR_=/var/www DBPASSWD_=ownyourbits +DESCRIPTION="Backup this NC instance to a file" DESTFILE=$DESTDIR_/nextcloud-bkp_`date +"%Y%m%d"`.tar DBBACKUP=nextcloud-sqlbkp_`date +"%Y%m%d"`.bak @@ -32,8 +33,9 @@ configure() mysqldump -u root -p$DBPASSWD_ --single-transaction nextcloud > $DBBACKUP echo -e "backup files..." - tar -cf $DESTFILE $DBBACKUP nextcloud/ || return 1 # TODO - echo -e "backup $DESTFILE generated" + tar -cf $DESTFILE $DBBACKUP nextcloud/ && \ + echo -e "backup $DESTFILE generated" || \ + echo -e "error generating backup" rm $DBBACKUP cd $BASEDIR_/nextcloud diff --git a/etc/nextcloudpi-config.d/nc-restore.sh b/etc/nextcloudpi-config.d/nc-restore.sh index d4d9808c8..1d3d1b1b3 100644 --- a/etc/nextcloudpi-config.d/nc-restore.sh +++ b/etc/nextcloudpi-config.d/nc-restore.sh @@ -21,6 +21,7 @@ BACKUPFILE_=/media/USBdrive/nextcloud-bkp_xxxxxxxx.tar BASEDIR_=/var/www DBPASSWD_=ownyourbits DBADMIN_=ncadmin +DESCRIPTION="Restore a previously backuped NC instance" show_info() {