I’m very new to owncloud, running on my raspi zeroW (stretch, php7, apache2). I have successfully installed and setup owncloud, migratet calendars and contacts. Now I want to backup calendars and contacts.
Is the mysqldump enough for that?
I tried to use
wget https://SERVER/remote.php/carddav/addressbooks/USER/ADDRESSBOOK?export
but get an certificate error even with --no-check-certificate.
So would I be able to restore contacts and calendars with the db backup, or using rsync to copy the whole install path /var/www/owncloud to a save place?
Thank you for your help
PS:
I now have a script which uses rsync to copy data and config directories as well as mysqldump of the database(s). Additionally I copy the whole owncloud directory and zip it. I hope this will be enough. Any thoughts or advises are much appreciated.
I wrote a bash-script calcardbackup which backups calendars and adressbooks of all users. Please pay attention to the new option -f in the latest release: when using this option there is no need anymore to give the passwords of the users.
Hey, I already tried your script, but there was also an error. Not shure what it was, I will look into that and report back. Maybe you can answer my question anyways?
PS: Just tried it and it worked like a charm! How can I set the output path?
PPS: Already found the examples and made a conf - Thank you very much!
I’m getting this error, when running your script from my script. My script sets owncloud to maintenace mode, rsyncs data and config, mysqldump, then run your script and disable maintenance mode.
Compressing backup as *.tar.gz file. Be patient - this may take a while.
tar: calcardbackup-2018-09-22: Datei hat sich beim Lesen geändert.
– calcardbackup: ERROR –
– ERROR: Compressing the files produced an error. See lines right above.
– calcardbackup: Exiting.
No, rsync only syncs data and config, then you script is invoked. I moved my script to the same folder as yours, then the script succeeded. As the error occurs when zipping the file it is not a big issue to me. As long as the ics and vcf files are backed up I’m fine with it.
I‘d quite like to understand what is going on there and fix it, if it is a bug in my script. Do you mind sharing your backup script and the calcardbackup configuration with me (remove sensitive values!)?
Thanks. I can’t reproduce the issue on my machine when using your script and configuration.
Here is what calcardbackup does:
it saves the ics and vcf files in a folder named calcardbackup-date inside the configured output directory (backupfolder)
it creates a compressed archive of the folder calcardbackup-date as tar.gz with tar
afterwards the folder calcardbackup-date inside the configured output directory (backupfolder) is being removed
The error you get is from tar which notices that the content of the folder calcardbackup-date is being modified while creating the archive (which of course has to result in an error). Is there any other program modifiying the content of that folder while my script is running?
Regarding your configuration question:
as long as you can open “https://ip.to.own.cloud” in a browser everything will be fine. In most use cases with modern owncloud versions (>=7.0) the URL is not needed anyway.
Another thing I noticed: you might want to change the rsync commands from (notice the change of slashes): rsync -Aax /path/to/owncloud/data/ /path/to/external/storage
to rsync -Aax /path/to/owncloud/data /path/to/external/storage/
to tidy up your backup directory a little bit.
The folder is located on my NAS Drive maybe this is indexing the files while tar is running? Nothing other is done to the calcardbackup backup directory.
Regarding the slashes I’m still confused about the usage
PS.:
Just played around with the slashes and came to the conclusion that
cp /path/src /path/dest #copy the folder src and it's contents to dest
cp /path/src/ /path/dest #copy the contents of src to dest
Strange, I know ran the script again, got the same error, but a new archive…?
I don’t care about that archive, as long as the files are all there. Could I disable compression in the config?
PS.: Found the option to disable compression…
does encryption work without compression or is it just to encrypt the tar?
PPS.: It’s all in the README.md