Created
January 31, 2012 18:20
-
-
Save emilpetkov/1712007 to your computer and use it in GitHub Desktop.
Decrypt and scp CSV files to remote server
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for file in *.pgp | |
do | |
if [[ $file =~ (\.*).pgp ]]; then | |
file_no_pgp="${file%.*}" | |
gpg --passphrase your_passphrase_here --output $file_no_pgp --decrypt $file | |
scp $file_no_pgp your_username@your_server:/var/www/ipg_data | |
echo "Decrypted ans scped file for processing: $file_no_pgp" | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
First version, the encrypted_files_dir, extension, remote server and SSH username should be received as params.