This commit is contained in:
committer@tuxwarrior
2026-02-24 18:35:15 -05:00
parent 56a2aa7cc9
commit 8f9f25bf72
12 changed files with 158 additions and 36 deletions

34
dots/bin/cryptomatorBackup.sh Executable file
View File

@@ -0,0 +1,34 @@
#!/usr/bin/env bash
# klevstul :: 26.02.24
# make sure cryptLocal is mounted and available
src_dir=/home/poq/.local/share/Cryptomator/mnt/cryptLocal
tmp_dir=/tmp
trg_dir=/home/poq/syncDir/0_downloads
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}/"