Thank you very much for the script and the advice! Its working very good. However I modified your script a litte bit. Rather than copying the files all in the same directory with every execution, I let the script create a folder with current date and saves the files all in this directory. This helps me a bit with the overview.
I want to share the mod, maybe this is helps someone too.
Bash
#!/bin/bash
# Sets the current date
dt=$(date +%y%m%d)
#creates folder with current date
mkdir PATH_TO_DATA/regen_omv/$dt
# Sets the path with current date to store the backup.
# Replace PATH_TO_DATA with the path of the folder where you want to store the backup.
bkp="/PATH_TO_DATA/regen_omv/$dt"
# Helpful message if you set notifications on the scheduled task
echo ""
echo "Backup to regenerate the system with date $dt in $bkp"
echo ""
# Does the extraction of the database, the list of users and the list of plugins simultaneously
rsync -av /etc/openmediavault/config.xml ${bkp} && dpkg -l | grep openmediavault > ${bkp}/plugins_list && cat /etc/passwd | grep /bin/sh > ${bkp}/users_list
# It does the extraction of the existing data in the /home folder.
# Remove the hash mark from the next line if you need to.
#rsync -av --delete /home/ ${bkp}/home
# It does the extraction of the xml files of virtual machines and KVM network configurations.
# Remove the hash mark from the next line if you need to.
#[ -d /etc/libvirt/qemu ] && rsync -av --delete /etc/libvirt/qemu/ ${bkp}/kvm
# You can copy and paste the line above and substitute the folder you want to have a backup of.
# For example, the following would extract the information from a custom installation of wireguard.
# Remove the hash mark from the next line if you need to.
#[ -d /etc/wireguard ] && rsync -av --delete /etc/wireguard/ ${bkp}/wireguard
# Generates a file in the backup folder with the extraction date.
#[ -f ${bkp}date* ] && rm ${bkp}date*
#touch ${bkp}date_$dt
Alles anzeigen