I'm looking for a possibility to backup my owncloud 9.1 instance to an hdd via a cronjob. I have allready looked at the provieded help-page by owncloud but want severeal instances. Like a backup every day and everytime tree instances. Like today is october 9th so I want a backup of october 9th, 8th and 7th. Best would be a bash-script I think, but I don't have really an idea how to do that. Maybe you can help me. This is where I'm at the moment:
#!/bin/bash # database mysqldump --lock-tables -h 127.0.0.1 -u oc_admin -p PASS > owncloud-sqlbkp_`date +"%Y%m%d"`.bak # data - directory rsync -Aax /owncloud/data/ /oc-backup/owncloud-dirbkp_`date +"%Y%m%d"`/ # config - directory rsync -Aax /var/www/html/site.de/config/ /oc-backup/owncloud-config-dirbkp_`date +"%Y%m%d"`/
Isn't it also necessary to set owncloud into maintenance mode and how is this possible via bash?
Thank's allready for your help!