#!/usr/bin/env bash # klevstul :: 26.02.24 src_dir=/home/poq/.local/share/Cryptomator/mnt/cryptLocal tmp_dir=/tmp trg_dir=/home/poq/syncDir/0_downloads # make sure cryptLocal is mounted and available if ! [ -d "$src_dir" ] then echo "missing source directory:" echo "$src_dir" echo "is the cryptLocal vault mounted?" exit fi # zip the content timestamp=$(date +%y%m%d) zip_file=${tmp_dir}/${timestamp}_cryptLocal.zip zip -r "${zip_file}" "${trg_dir}/" # gpg encrypt the content gpg --encrypt --sign --recipient frode@klevstul.com "${zip_file}" # delete the .zip file srm -v "${zip_file}" # move the .gpg file to the target dir mv "${zip_file}.gpg" "${trg_dir}/" ls -al "${trg_dir}/"