User Tools

Site Tools


Backup of Nextcloud instance

You can find more information in documentation here - https://docs.nextcloud.com/server/12/admin_manual/maintenance/backup.html

Below is set of command which works on Turris Omnia

# enable maintenance mode
sudo -u nobody php-cli /srv/www/nextcloud/occ  maintenance:mode --on

# backup dat
rsync -ax /srv/www/nextcloud /srv/www/nextcloud-dirbkp_`date +"%Y%m%d"`/

# backup database
mysqldump --single-transaction -h localhost -u root nextcloud  > nextcloud-sqlbkp_`date +"%Y%m%d"`.bak

# disable maintenance mode
sudo -u nobody php-cli /srv/www/nextcloud/occ  maintenance:mode --off