Assorted shell and Python scripts
at main 785 B view raw
1#!/usr/bin/env bash 2 3set -euxo pipefail 4 5if test -f "${HOME}/.env_common"; then 6 source "${HOME}/.env_common" 7fi 8 9cleanup() { 10 echo "Cleaning up" 11 rm -rfv /tmp/mail* 12} 13 14trap cleanup 0 1 2 3 6 15 16DATE=$(date '+%Y-%m-%d') 17tar czf "/tmp/mail-${DATE}.tar.gz" /naspool/mail 18age --recipient 'age12pcwr6d8w6wfh5ymarphypzlyqxza3c3xj7cseturzyu70s02umske6mt6' --output "/tmp/mail-${DATE}.tar.gz.age" "/tmp/mail-${DATE}.tar.gz" 19scp "/tmp/mail-${DATE}.tar.gz.age" root@aux-remote.carp-wyvern.ts.net:/bpool/encrypted_mail 20ssh root@aux-remote.carp-wyvern.ts.net -- find /bpool/encrypted_mail -maxdepth 1 -type f -mtime +7 -delete 21 22curl \ 23 -H prio:default \ 24 -H tags:incoming_envelope \ 25 -d "encrypt_mail: success" \ 26 "${NTFY_SERVER}/backups" 27 28# vim: ts=4 sts=4 sw=4 et ai ft=bash