Maintenance mode during automatic backup?

backup
help

#1

Dear all,
the admin manual advises to use rsync + mysqldump to make backups. I was wondering what could happen if during the backup job some user is working on his files. It could happen that the database and the data directory do not match.
I plan on implementing automated backups of my cloud. I'm afraid to make corrupt backups if the files get modified during the backup.
If the server goes to maintenance for a full backup, it can take several hours (the data folder is about 1TB), so that should be avoided. Also, going automatically to maintenance mode does not seem like a good thing to do.

I'm also thinking of just mounting the webdav share of the cloud in the backup server and making a backup of the files. This would cause no downtime and as far as I know, owncloud would handle the problem of a user working on the files at the same time. Is this a good idea?

How do you do automatic backups of your owncloud?

Thanks!


#2

You can use LVM or file systems that support snapshots (btrfs, zfs), put owncloud in maintenance mode, run mysqldump, then create a snapshot. >ou can turn off maintenance mode and run your backup-script from the snapshot.

Without snapshots: Just use the maintenance mode during mysqldump. Later the files could change, but if you do this at night time, there should be very little effect. After restoring your backup, you can run a ./occ files:scan to identify differences between filecache-table and file system.