Skip to content

Bash script to backup calendars and addressbooks from a local Own-/Nextcloud installation

License

Notifications You must be signed in to change notification settings

heaterC/calcardbackup

 
 

Repository files navigation

calcardbackup

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).

Requirements

  • 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 or sqlite3)
  • if backups shall be zipped (instead of default gzipped tarball): package zip

Installation

  1. Clone the repository to your server and enter the repo:
    git clone https://github.com/BernieO/calcardbackup
    cd calcardbackup

  2. Copy example files:
    cp calcardbackup.conf.example calcardbackup.conf
    cp users.txt.example users.txt

  3. Change path to your Own-/Nextcloud installation in config file calcardbackup.conf with your favorite text editor.

  4. Fill file users.txt with usernames and according passwords separated by a colon with one user per line (again with your favorite text editor).

  5. Change ownership of repo to your webservers user (here www-data) and restrict access to users.txt:
    chown -R www-data:www-data .
    chmod 600 users.txt

  6. Run script as user www-data:
    sudo -u www-data ./calcardbackup

  7. Check output of script - it will tell, if anything is missing or has to be configured in calcardbackup.conf

  8. Find your backup in directory backups/

Interested in more details?

Find more details here (sorry, currently only in german):
Blog article about calcardbackup

About

Bash script to backup calendars and addressbooks from a local Own-/Nextcloud installation

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 100.0%