||3 months ago|
|LICENSE||4 months ago|
|README-DE.md||3 months ago|
|README.md||3 months ago|
|kalenderbackup.sh||4 months ago|
🇩🇪 README in Deutsch
What is the purpose of "kalenderbackup"?
This script calls calcardbackup from BernieO to automatically backup address books and calenders of your Nextcloud instance.
Hey, calcardbackup does the same as calcardbackup so why should I use "kaldenderbackup"?
That´s a good question! calcardbackup is a very powerful tool which provides a lot of features. So here are my BUTs to create kalenderbackup 😊
The script provides the following features:
- you can call the script from any location
- creates a detailed log file
- mounts an external storage which is attached to your server
- calls calcardbackup to export address books and calendars
- stores the export of your address books and contacts on the external storage
- sends the exports of address books and calenders, log files and this script via e-mail to a defined e-mail address in a single message
- checks for a new version of calcardbackup
That sounds very complicated!
You can easily customize the script because it is
easy to understand
uses variables which you can alter as needed
Can the whole process get automatized?
Of course, you can automatize the hole process by setting up a cron job to trigger kalenderbackup.sh.
Sounds like you created a double backup with the script?
Yes, you are right! A very nice feature is the double layer of security the script provides for your precious address books and calenders,
it stores the backup on an external storage
it sends the export to a defined e-mail address
so you have TWO backups on TWO separate storages which you can easily restore.
There are many other ways to store your exports on a physically separated device, too. Here are some examples:
Use rsync to put your data on a total different storage which is physically separated from your Nextcloud. In this blog post I show you how to backup a hole Nextcloud instance via rsync → Datensicherung für die Nextcloud mit rsync
Use BorgBackup to put your data encrypted on a total different storage which is physically separated from your Nextcloud. In this blog post I show you hot to set it up → Datensicherung für die Nextcloud mit BorgBackup
You can also use your FRITZ!Box as an external storage → AVM NAS als Festplatte bei Raspberry Pi als Festplatte mounten
What is required to use "kalenderbackup"?
Firstly, you need the most important calcardbackup which is also maintained on codeberg.org → https://codeberg.org/BernieO/calcardbackup
Secondly you have to have a working Mail Transfer Agent (MTA) like Postfix and an e-mail client like mutt installed on you server. Of course you find a detailed manual how to setup both on my website: → E-Mail-Versand für den Raspberry Pi konfigurieren
Are there any security issues?
To be honest, there can be some. But the issues are not really related to the script itself it is more related to the script permissions and you server admins.
The script requires some high permissions,
- root permissions to mount external storage devices and
- www-data permissions to call calcardbackup (www-data is needed because that is the users that runs Nextcloud on your server)
To achieve both that we have to use sudo crontab -e.
The high risk is therefore, if an user gains write access to the script, he/she can execute unauthorized commands though the crontab.
Please double check
- the permissions of the script
- users who can use sudo or root on your system are setup correctly
- that personalized accounts for your admins are in use
If you are interested in securing your system in a good way with hardware tokens and certificates, please have a close look at the YubiKey category on my website
All good! So how can I install the script?
Gladly, that is very simple!
This is a very short installation instruction. A more detailed one you can find on my website → Nextcloud – Datensicherung von Kalendern und Adressbüchern automatisch erstellen
Make sure all dependencies for your external storage, MTA, etc. are dissolved.
Clone the entire Git repository to your hard disk (optional)
git clone https://codeberg.org/strobelstefan.org/kalenderbackup.git
Create script directory
sudo mkdir /etc/scripts
Copy the script into the newly created directory (depending on point 2)
cd kalenderbackup sudo cp kalenderbackup.sh /etc/scripts
cdinto that directory
Set the correct permissions
sudo chown root:root kalenderbackup.sh sudo chmod 0600 kalenderbackup.sh sudo chmod +x kalenderbackup.sh
Setup a cron job
# Calender & Address book backup 00 20 * * * /bin/bash /etc/scripts/kalenderbackup.sh
Do you find the templates helpful, then feel free to buy me a coffee ☕
Du findest meine Vorlagen hilfreich, dann kannst du mir gerne einen Kaffee ausgeben ☕
You can find more exciting articles on IT topics on my website www.strobelstefan.org
There you can find more articles about Nextcloud and the popular Raspberry Pi:
The working methods described here are based on my personal experience and my personal thought processes. I do not guarantee the results; trying out and implementing the described procedures is entirely at your own risk and responsibility.
Therefore, please make a backup before making any changes to your system or configuration so that you can restore it if the worst comes to the worst.
Die hier geschilderten Arbeitsweisen basieren auf meiner persönlichen Erfahrung und meinen persönlichen Gedankengängen. Ich übernehme keine Garantie für die Resultate; Ausprobieren und Implementieren der beschriebenen Vorgehensweisen erfolgt ausschließlich auf eigene Verantwortung und Gefahr.
Bitte erstellt deshalb vor jeder Änderung an eurem System oder Konfiguration ein Backup, damit ihr im Fall der Fälle eine Wiederherstellung durchführen könnt.