Skip to content

Commit

Permalink
improvements for nc-backup and nc-restore
Browse files Browse the repository at this point in the history
  • Loading branch information
nachoparker committed May 25, 2017
1 parent 7ea3dbe commit c8ee570
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 4 additions & 2 deletions etc/nextcloudpi-config.d/nc-backup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
1 change: 1 addition & 0 deletions etc/nextcloudpi-config.d/nc-restore.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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()
{
Expand Down

0 comments on commit c8ee570

Please sign in to comment.