This Bash-script exports calendars and addressbooks from Owncloud/Nextcloud as .ics and .vcf files and saves them compressed (.tar.gz or .zip) in a given folder.
Optionally the Owncloud/Nextcloud-database can be backed up as well (default: no backup of database).
Additionally there is an config option to delete backups that are older than X days (default: no delete).
- local installation of Own-/Nextcloud >= 5.0 with MySQL/MariaDB or SQLite3 (PostgreSQL unsupported)
- Packages
grep
sed
curl
and according database packages (mysql-server
/mariadb-server
orsqlite3
) - if backups shall be zipped (instead of default gzipped tarball): package
zip
-
Clone the repository to your server and enter the repo:
git clone https://github.com/BernieO/calcardbackup
cd calcardbackup
-
Copy example files:
cp calcardbackup.conf.example calcardbackup.conf
cp users.txt.example users.txt
-
Change path to your Own-/Nextcloud installation in config file
calcardbackup.conf
with your favorite text editor. -
Fill file
users.txt
with usernames and according passwords separated by a colon with one user per line (again with your favorite text editor). -
Change ownership of repo to your webservers user (here
www-data
) and restrict access tousers.txt
:
chown -R www-data:www-data .
chmod 600 users.txt
-
Run script as user
www-data
:
sudo -u www-data ./calcardbackup
-
Check output of script - it will tell, if anything is missing or has to be configured in
calcardbackup.conf
-
Find your backup in directory
backups/
Find more details here (sorry, currently only in german):
Blog article about calcardbackup