← Notes

December 8, 2020

Nextcloud server on Raspberry Pi: Backup

Nextcloud server on Raspberry Pi: Backup


Tags: raspberry pi backup nextcloud

First thing put the nextcloud server in maintenance mode:

sudo -u www-data php occ maintenance:mode --on

Backup

rsync -Aavx nextcloud/ nextcloud-dirbkp_`date +"%Y%m%d"`/

Backup of the database:

mysqldump --single-transaction -u [username] -p [db_name] > nextcloud-sqlbkp_`date +"%Y%m%d"`.bak
sudo -u www-data php occ maintenance:mode --off

We can now turn maintenance mode off.