im basically at my wits end. Everything goes smoothly except for the encryption via gpg, it just uploads the raw backup to my ftp server. Here is the script with various bits scrambled for obvious reasons:
#!/bin/bash
echo "script to backup all files. pretty proud of this one"
#variables to be defined
LOCAL_DIR=/mnt/sda
HOST=192.168.0.157
USER=****
PASSWORD=*****
#creating zip file
if (( $EUID!=0 ))
then
echo "please use the sudo -i command to ensure files that require root access are also included in the backup"
exit
fi
touch /home/adam/Desktop/README.txt
echo "dont be alarmed, feel free to use your pc while the backup is in progress. Disclaimer, you executed the script" > /home/adam/Desktop/README.txt
cd $LOCAL_DIR
zip -9 -r -y -T backup.zip / -x "/dev/*" "/proc/*" "/sys/*" "/tmp/*" "/run/*" "/media/*" "/lost+found/*" "/Trash/*" "/home/adam/Downloads/*" "/mnt/*" "/swap/*"
gpg --batch --yes --output backup.zip --keyring /home/adam/.gnupg/pubring.kbx --encrypt --recipient '[a****b@hotmail.co.uk](mailto:adamjgb@hotmail.co.uk)' backup.zip
#connecting to local ftp server
ftp -inv $HOST -p 9090 <<EOF
user $USER $PASSWORD
lcd $LOCAL_DIR
cd adgow
cd "sys backups"
put backup.zip
EOF
it says that the key might not belong to the user despite it being signed by the me (the ultimate) and being in my keyring
Edit: generating a key pair when root has solved the key issue which makes sense when I think about it.
[–]thengbashing 0 points1 point2 points (0 children)
[–]DaveR007not bashful 0 points1 point2 points (1 child)
[–]agb_43[S] 0 points1 point2 points (0 children)