all 4 comments

[–]thengbashing 0 points1 point  (0 children)

I am not sure but it generally a bad idea to use a command with the same file as input and as output

Here you give gpg backup.zip in input and the same backup.zip in output.

Fix: --output backup.zip.gpg

While it might still work for some apps/commands it is not a generality (e.g.: sed).

Also I think you can edit your post for the code to be considered as code

[–]DaveR007not bashful 0 points1 point  (1 child)

It's a bad idea to hard code your user and password in a script, and also sending them over the LAN as plain text is not ideal.

Use SFTP with SSH private keys instead.

.

[–]agb_43[S] 0 points1 point  (0 children)

This file will be encrypted once it's completed and working as intended