wip
This commit is contained in:
34
dots/bin/cryptomatorBackup.sh
Executable file
34
dots/bin/cryptomatorBackup.sh
Executable 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}/"
|
||||
Reference in New Issue
Block a user