Encrypting and compressing backups

To avoid unauthorized access and tampering of the backup file, you can encrypt and compress the backup.

Procedure

  • To encrypt and compress the contents of the current working directory, enter the following command.
    tar -czf - * | openssl enc -e -aes256 -out secured.tar.gz
  • To encrypt and compress the contents of the directory for a pod container, enter the following command.
    oc exec -it $POD -c $CONTAINER --namespace $NAMESPACE-- bash -c "tar -cz
    $DIRECTORY/* | openssl enc -e -aes256 -out <targzfilename> "