If one doesn't want to dig into sophisticated backup solutions, it is always possible to write a shell script that gathers data and compresses it. Because of privacy issues one might want to encrypt the backup archive by using a suitable tool (zip/rar with password, gpg etc).
Now when it comes to automation, the problem of revealing the password steps in which creates the following issues:
- When running the backup script from console, the password is just entered interactively.
- When running the script via cron, this is impossible.
- Hardcoding the password in the shell script is bad and ugly.
I believe this is a common situation for this problem. What is the generic or typical solution for the problem of encrypting data with a password, but in automated way?