sukria / Backup-Manager

Versatile yet easy to use command line backup tool for GNU/Linux. Suitable for desktop and servers.
http://www.backup-manager.org/
GNU General Public License v2.0
277 stars 88 forks source link

Support for encryption of dar archives #114

Open mbrandis opened 6 years ago

mbrandis commented 6 years ago

Hi!

Could you please add the encryption of dar archives with public keys? This would be a really helpful feature for the future!

Thanks in advance!

Cheers, Mark

appshbrockmann commented 5 years ago

I write my gpg files to a subfolder (called gpg) with the following script (automated in BM_POST_BACKUP_COMMAND):

#!/bin/bash

if [ ! -e /etc/backup-manager.conf ]; then echo "ERROR: Backup Manager is not present on your system." exit 1 fi

if [ ! -e /etc/backup-manager/gpg-copy.conf ]; then echo "ERROR: unable to find gpg-copy.conf configuration file in /etc/backup-manager/." exit 1 fi

source /etc/backup-manager.conf source /etc/backup-manager/gpg-copy.conf

for DATEI in $(find ${BM_REPOSITORY_ROOT}/ -newer ${BM_REPOSITORY_ROOT}/gpgtransfer.ref -type f | tac); do /usr/bin/gpg -o ${DATEI}.gpg -r ${BM_ENCRYPTION_RECIPIENT} -e ${DATEI}; mv ${DATEI}.gpg ${GPG_COPY_FOLDERS} /bin/chmod 0666 ${GPG_COPY_FOLDERS}/$(/usr/bin/basename ${DATEI}.gpg) done

touch ${BM_REPOSITORY_ROOT}/gpgtransfer.ref

exit 0

the file gpgtransfer.ref is just empty, only there for the last edit time, the file gpg-copy.conf looks like: export GPG_COPY_FOLDERS="whateverFolderYouLike"

This script will however never delete anything nor integrate with other features of backup-manager (ftp, scp etc.). Use at your own risk.

Good Bye Hermann