Skip to content

Instantly share code, notes, and snippets.

@emilpetkov
Created January 31, 2012 18:20
Show Gist options
  • Save emilpetkov/1712007 to your computer and use it in GitHub Desktop.
Save emilpetkov/1712007 to your computer and use it in GitHub Desktop.
Decrypt and scp CSV files to remote server
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
@emilpetkov
Copy link
Author

First version, the encrypted_files_dir, extension, remote server and SSH username should be received as params.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment