34 lines
765 B
Bash
Executable File
34 lines
765 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
# klevstul :: push content from cryptLocal to cryptCloud (cryptomator vaults) :: apr 2022
|
|
|
|
# note: both vaults must be mounted before running this script
|
|
|
|
|
|
if [ "$EUID" -eq 0 ]
|
|
then echo "error: do not run as 'root'"
|
|
exit
|
|
fi
|
|
|
|
src_dir=/home/poq/.local/share/Cryptomator/mnt/cryptLocal/content
|
|
trg_dir=/home/poq/.local/share/Cryptomator/mnt/cryptCloud/
|
|
|
|
if ! [ -d "$src_dir" ]
|
|
then
|
|
echo "missing source directory:"
|
|
echo "$src_dir"
|
|
echo "has something happened to the 'content/' directory?"
|
|
exit
|
|
fi
|
|
|
|
if ! [ -d "${trg_dir}/content" ]
|
|
then
|
|
echo "missing target directory:"
|
|
echo "$trg_dir"
|
|
echo "is the cryptCloud vault unlocked?"
|
|
exit
|
|
fi
|
|
|
|
echo copying files from $src_dir to $trg_dir...
|
|
rsync -v -r -a --delete $src_dir $trg_dir
|