X-Git-Url: https://plomlompom.com/repos/foo.html?a=blobdiff_plain;f=all_new_2018%2Fuser_files%2Fencrypter.sh;h=e2ebd446e6eec60510b283b2e502bb67f31f10e4;hb=428f427cf7adac99766099318302416df51b08fc;hp=6a35954e37f3f9e36688339a830b070f46e90738;hpb=b20927bac93b8e612be6c66e86c440e4d682bcda;p=config
diff --git a/all_new_2018/user_files/encrypter.sh b/all_new_2018/user_files/encrypter.sh
old mode 100644
new mode 100755
index 6a35954..e2ebd44
--- a/all_new_2018/user_files/encrypter.sh
+++ b/all_new_2018/user_files/encrypter.sh
@@ -1,4 +1,9 @@
#!/bin/sh
+# Encrypt dated weechatlog files older than one day to GPG target defined in
+# ~/.encrypt_target
set -e
gpg_key=$(cat ~/.encrypt_target)
+cd ~/weechatlogs/irc/
+find . -regextype posix-egrep -regex '^.*/.*/.*\.[0-9]{4}-[0-9]{2}-[0-9]{2}\.weechatlog$' -type f -mtime +1 -exec gpg --recipient "${gpg_key}" --trust-model always --encrypt {} \; -exec rm {} \;
+