Created
February 21, 2017 15:02
-
-
Save kapcom01/ad2c279750830038e8fa3c39ddf2ef5b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
user=manolis | |
backups=/home/manolis/backups | |
if [[ $EUID > 0 ]] | |
then echo "Please run as root" | |
exit | |
fi | |
# maintenance mode on | |
nextcloud.occ maintenance:mode --on | |
# if there is no backups directory then create it | |
if [ ! -d $backups ] | |
then | |
mkdir $backups | |
chown $user:$user $backups | |
fi | |
bakdir=$backups/backup-$(date +%Y%m%d) | |
# config | |
echo "Backing up config file..." | |
rsync -Aax /snap/nextcloud/current/htdocs/config/config.php $bakdir/ | |
# database | |
echo "Backing up database..." | |
nextcloud.mysqldump > $bakdir/sqlbkp.bak | |
# nextcloud-data | |
echo "Backing up data..." | |
rsync -Aax /var/snap/nextcloud/common/nextcloud/data/ $bakdir/nextcloud-data/ | |
# owner manolis:manolis | |
chown -R $user:$user $bakdir | |
# maintenance mode off | |
nextcloud.occ maintenance:mode --off | |
echo "Backup finished." | |
echo "When restoring, don't forget to set the correct permissions." |
config.php at /snap/nextcloud/current/htdocs/config/config.php
does look to be the wrong one ?
The file is at the read only section of the nextcloud snap and can not be restored.
Eventually config.php at /var/snap/nextcloud/current/nextcloud/config/
is the correct one ?
also it have to parse config.php for 'datadirectory' =>
for me - there is mounted resource from external (for snap) directory
config.php at /snap/nextcloud/current/htdocs/config/config.php does look to be the wrong one ?
The file is at the read only section of the nextcloud snap and can not be restored.
Eventually config.php at /var/snap/nextcloud/current/nextcloud/config/ is the correct one ?
I concur.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is this for Nextcloud 12 snap?