Skip to content

Instantly share code, notes, and snippets.

@network23
Created March 22, 2017 11:31
Show Gist options
  • Save network23/42e81eef1c6da398f74ba137cbd22fb5 to your computer and use it in GitHub Desktop.
Save network23/42e81eef1c6da398f74ba137cbd22fb5 to your computer and use it in GitHub Desktop.
#!/bin/bash
#***********************************************************************************************#
# encrypt_folders.sh #
# asks for password, encrypt all folders in current dir with 7zip. Output files are 7z #
# #
# Version: 0.2 #
#***********************************************************************************************#
read -s -p "Password: " PASS
for folder in */
do
7z a -r -mx0 -mmt=3 -mhe=on -p$PASS "${folder%/}.7z" "$folder"
done
# mx = compression level: 0 is store, 9 is max compression. mmt= threads. mhe=header encryption (file names).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment