Backup key parameters

This commit is contained in:
Bob Mottram 2015-09-26 13:33:18 +01:00
parent 1b990c48e1
commit 9432db1cf1
1 changed files with 10 additions and 2 deletions

View File

@ -2428,7 +2428,11 @@ function backup_directory_to_usb {
echo ' exit 43382' >> /usr/bin/$BACKUP_SCRIPT_NAME echo ' exit 43382' >> /usr/bin/$BACKUP_SCRIPT_NAME
echo ' fi' >> /usr/bin/$BACKUP_SCRIPT_NAME echo ' fi' >> /usr/bin/$BACKUP_SCRIPT_NAME
echo -n ' MY_BACKUP_KEY_ID=$(gpg --list-keys "$MY_NAME (backup key)" ' >> /usr/bin/$BACKUP_SCRIPT_NAME echo -n ' MY_BACKUP_KEY_ID=$(gpg --list-keys "$MY_NAME (backup key)" ' >> /usr/bin/$BACKUP_SCRIPT_NAME
echo "| grep 'pub ' | awk -F ' ' '{print $2}' | awk -F '/' '{print $2}')" >> /usr/bin/$BACKUP_SCRIPT_NAME echo -n "| grep 'pub ' | awk -F ' ' '{print " >> /usr/bin/$BACKUP_SCRIPT_NAME
echo -n '$2' >> /usr/bin/$BACKUP_SCRIPT_NAME
echo -n "}' | awk -F '/' '{print " >> /usr/bin/$BACKUP_SCRIPT_NAME
echo -n '$2' >> /usr/bin/$BACKUP_SCRIPT_NAME
echo "}')" >> /usr/bin/$BACKUP_SCRIPT_NAME
echo ' obnam backup -r $USB_MOUNT/backup/${2} --encrypt-with $MY_BACKUP_KEY_ID ${1}' >> /usr/bin/$BACKUP_SCRIPT_NAME echo ' obnam backup -r $USB_MOUNT/backup/${2} --encrypt-with $MY_BACKUP_KEY_ID ${1}' >> /usr/bin/$BACKUP_SCRIPT_NAME
else else
# For rsyncrypto usage see http://archive09.linux.com/feature/125322 # For rsyncrypto usage see http://archive09.linux.com/feature/125322
@ -3760,7 +3764,11 @@ function backup_directory_to_friend {
echo ' exit 43382' >> /usr/bin/$BACKUP_TO_FRIENDS_SCRIPT_NAME echo ' exit 43382' >> /usr/bin/$BACKUP_TO_FRIENDS_SCRIPT_NAME
echo ' fi' >> /usr/bin/$BACKUP_TO_FRIENDS_SCRIPT_NAME echo ' fi' >> /usr/bin/$BACKUP_TO_FRIENDS_SCRIPT_NAME
echo -n ' MY_BACKUP_KEY_ID=$(gpg --list-keys "$MY_NAME (backup key)" ' >> /usr/bin/$BACKUP_TO_FRIENDS_SCRIPT_NAME echo -n ' MY_BACKUP_KEY_ID=$(gpg --list-keys "$MY_NAME (backup key)" ' >> /usr/bin/$BACKUP_TO_FRIENDS_SCRIPT_NAME
echo "| grep 'pub ' | awk -F ' ' '{print $2}' | awk -F '/' '{print $2}')" >> /usr/bin/$BACKUP_TO_FRIENDS_SCRIPT_NAME echo -n "| grep 'pub ' | awk -F ' ' '{print " >> /usr/bin/$BACKUP_TO_FRIENDS_SCRIPT_NAME
echo -n '$2' >> /usr/bin/$BACKUP_TO_FRIENDS_SCRIPT_NAME
echo -n "}' | awk -F '/' '{print " >> /usr/bin/$BACKUP_TO_FRIENDS_SCRIPT_NAME
echo -n '$2' >> /usr/bin/$BACKUP_TO_FRIENDS_SCRIPT_NAME
echo "}')" >> /usr/bin/$BACKUP_TO_FRIENDS_SCRIPT_NAME
echo -n ' obnam backup -r $SERVER_DIRECTORY/backup/ ' >> /usr/bin/$BACKUP_TO_FRIENDS_SCRIPT_NAME echo -n ' obnam backup -r $SERVER_DIRECTORY/backup/ ' >> /usr/bin/$BACKUP_TO_FRIENDS_SCRIPT_NAME
echo '--encrypt-with $MY_BACKUP_KEY_ID ' >> /usr/bin/$BACKUP_TO_FRIENDS_SCRIPT_NAME echo '--encrypt-with $MY_BACKUP_KEY_ID ' >> /usr/bin/$BACKUP_TO_FRIENDS_SCRIPT_NAME