aboutsummaryrefslogtreecommitdiff
path: root/scripts/c
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2021-01-17 19:31:20 -0300
committerEuAndreh <eu@euandre.org>2021-01-17 19:31:20 -0300
commitbede9b3d35c3d385504d3cc661c60066a8099dfe (patch)
tree5a6863927ac553eb1bea0ff4612019d1503b4940 /scripts/c
parentRemove unused scripts (diff)
downloaddotfiles-bede9b3d35c3d385504d3cc661c60066a8099dfe.tar.gz
dotfiles-bede9b3d35c3d385504d3cc661c60066a8099dfe.tar.xz
Move cron scripts into cron/, remove ad-hoc subfolder
Diffstat (limited to '')
-rwxr-xr-xscripts/c (renamed from scripts/ad-hoc/c)0
-rwxr-xr-xscripts/copy-public-key.sh (renamed from scripts/ad-hoc/copy-public-key.sh)0
-rwxr-xr-xscripts/cron/annex-job.sh31
-rwxr-xr-xscripts/cron/backup-job.sh31
-rwxr-xr-xscripts/cron/copy-box-backups-job.sh31
-rwxr-xr-xscripts/cron/deliver-my-enqueued-emails.sh5
-rwxr-xr-xscripts/cron/deliver-queued-mail.sh18
-rwxr-xr-xscripts/cron/elfeed-job.sh31
-rwxr-xr-xscripts/cron/mbox-archive-job.sh31
-rwxr-xr-xscripts/cron/mr-remotes-backup-job.sh31
-rwxr-xr-xscripts/cron/notmuch-dump-job.sh31
-rwxr-xr-xscripts/cron/repo-update-job.sh31
-rwxr-xr-xscripts/cron/report-summary-job.sh31
-rwxr-xr-xscripts/cron/sync-mail.sh21
14 files changed, 0 insertions, 323 deletions
diff --git a/scripts/ad-hoc/c b/scripts/c
index 9b220622..9b220622 100755
--- a/scripts/ad-hoc/c
+++ b/scripts/c
diff --git a/scripts/ad-hoc/copy-public-key.sh b/scripts/copy-public-key.sh
index b864b4b1..b864b4b1 100755
--- a/scripts/ad-hoc/copy-public-key.sh
+++ b/scripts/copy-public-key.sh
diff --git a/scripts/cron/annex-job.sh b/scripts/cron/annex-job.sh
deleted file mode 100755
index 3d03297e..00000000
--- a/scripts/cron/annex-job.sh
+++ /dev/null
@@ -1,31 +0,0 @@
-#!/bin/sh -eux
-LOG_FILE="$(mktemp)"
-{
- finish() {
- status=$?
- if [ $status = 0 ]; then
- STATUS="✅ SUCCESS (status $status)"
- else
- STATUS="❌ FAILURE (status $status)"
- fi
-
- echo "Registering status locally..."
- set -x
- printf '%s annex\n' "$status" >> "/tmp/cron-dbg.summary.$(date -I).euandreh.log"
-
- echo "Sending report email..."
-
- SUBJECT="Job report on $(hostname): ${STATUS} for annex-job.sh"
- gpg -easr eu@euandre.org < "$LOG_FILE" | \
- mail eu@euandre.org \
- -s "$SUBJECT" \
- -a 'From:eu@euandre.org' \
- --content-type 'text/plain; charset=utf-8'
- echo 'Mail sent!'
- }
- trap finish EXIT
-
- echo "Starting: $(date -Is)"
- ~/dev/libre/dotfiles/scripts/ad-hoc/annex.sh
- echo "Finishing: $(date -Is)"
-} | tee "$LOG_FILE" 2>&1
diff --git a/scripts/cron/backup-job.sh b/scripts/cron/backup-job.sh
deleted file mode 100755
index ef9be7a7..00000000
--- a/scripts/cron/backup-job.sh
+++ /dev/null
@@ -1,31 +0,0 @@
-#!/bin/sh -eux
-LOG_FILE="$(mktemp)"
-{
- finish() {
- status=$?
- if [ $status = 0 ]; then
- STATUS="✅ SUCCESS (status $status)"
- else
- STATUS="❌ FAILURE (status $status)"
- fi
-
- echo "Registering status locally..."
- set -x
- printf '%s backup\n' "$status" >> "/tmp/cron-dbg.summary.$(date -I).euandreh.log"
-
- echo "Sending report email..."
-
- SUBJECT="Job report on $(hostname): ${STATUS} for backup-job.sh"
- gpg -easr eu@euandre.org < "$LOG_FILE" | \
- mail eu@euandre.org \
- -s "$SUBJECT" \
- -a 'From:eu@euandre.org' \
- --content-type 'text/plain; charset=utf-8'
- echo 'Mail sent!'
- }
- trap finish EXIT
-
- echo "Starting: $(date -Is)"
- ~/dev/libre/dotfiles/scripts/ad-hoc/backup.sh
- echo "Finishing: $(date -Is)"
-} | tee "$LOG_FILE" 2>&1
diff --git a/scripts/cron/copy-box-backups-job.sh b/scripts/cron/copy-box-backups-job.sh
deleted file mode 100755
index da7e11db..00000000
--- a/scripts/cron/copy-box-backups-job.sh
+++ /dev/null
@@ -1,31 +0,0 @@
-#!/bin/sh -eux
-LOG_FILE="$(mktemp)"
-{
- finish() {
- status=$?
- if [ $status = 0 ]; then
- STATUS="✅ SUCCESS (status $status)"
- else
- STATUS="❌ FAILURE (status $status)"
- fi
-
- echo "Registering status locally..."
- set -x
- printf '%s copy-box-backups\n' "$status" >> "/tmp/cron-dbg.summary.$(date -I).euandreh.log"
-
- echo "Sending report email..."
-
- SUBJECT="Job report on $(hostname): ${STATUS} for copy-box-backups-job.sh"
- gpg -easr eu@euandre.org < "$LOG_FILE" | \
- mail eu@euandre.org \
- -s "$SUBJECT" \
- -a 'From:eu@euandre.org' \
- --content-type 'text/plain; charset=utf-8'
- echo 'Mail sent!'
- }
- trap finish EXIT
-
- echo "Starting: $(date -Is)"
- ~/dev/libre/dotfiles/scripts/ad-hoc/copy-box-backups.sh
- echo "Finishing: $(date -Is)"
-} | tee "$LOG_FILE" 2>&1
diff --git a/scripts/cron/deliver-my-enqueued-emails.sh b/scripts/cron/deliver-my-enqueued-emails.sh
deleted file mode 100755
index 9dadf43f..00000000
--- a/scripts/cron/deliver-my-enqueued-emails.sh
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/sh -eux
-
-echo "Starting $(date -Is)"
-find ~/mbsync/my-queued-emails/ -type f -exec sh -c '$HOME/annex/bin/misc/mail/dispatch-email.sh "$1" && trash "$1"' _ {} \;
-echo "Done $(date -Is)"
diff --git a/scripts/cron/deliver-queued-mail.sh b/scripts/cron/deliver-queued-mail.sh
deleted file mode 100755
index 0dde65a6..00000000
--- a/scripts/cron/deliver-queued-mail.sh
+++ /dev/null
@@ -1,18 +0,0 @@
-#!/usr/bin/env bash
-set -Eeuo pipefail
-
-exec &> /dev/stdout
-echo "Starting $(date -Is)"
-
-if [[ "$(find ~/mbsync/queued-email/ -type f -not -name 'index' | wc -l)" = 0 ]]; then
- echo 'No queued emails found. noop'
-else
- # https://github.com/syl20bnr/spacemacs/issues/4504#issuecomment-232973179
- emacs -batch \
- -l ~/.emacs.d/init.el \
- -l ~/annex/bin/misc/mail/notmuch.el \
- --eval "(run-hooks 'emacs-startup-hook)" \
- --eval '(smtpmail-send-queued-mail)'
-fi
-
-echo "Finishing: $(date -Is)"
diff --git a/scripts/cron/elfeed-job.sh b/scripts/cron/elfeed-job.sh
deleted file mode 100755
index c0c3ac1a..00000000
--- a/scripts/cron/elfeed-job.sh
+++ /dev/null
@@ -1,31 +0,0 @@
-#!/bin/sh -eux
-LOG_FILE="$(mktemp)"
-{
- finish() {
- status=$?
- if [ $status = 0 ]; then
- STATUS="✅ SUCCESS (status $status)"
- else
- STATUS="❌ FAILURE (status $status)"
- fi
-
- echo "Registering status locally..."
- set -x
- printf '%s elfeed\n' "$status" >> "/tmp/cron-dbg.summary.$(date -I).euandreh.log"
-
- echo "Sending report email..."
-
- SUBJECT="Job report on $(hostname): ${STATUS} for elfeed-job.sh"
- gpg -easr eu@euandre.org < "$LOG_FILE" | \
- mail eu@euandre.org \
- -s "$SUBJECT" \
- -a 'From:eu@euandre.org' \
- --content-type 'text/plain; charset=utf-8'
- echo 'Mail sent!'
- }
- trap finish EXIT
-
- echo "Starting: $(date -Is)"
- ~/dev/libre/dotfiles/scripts/ad-hoc/elfeed.sh
- echo "Finishing: $(date -Is)"
-} | tee "$LOG_FILE" 2>&1
diff --git a/scripts/cron/mbox-archive-job.sh b/scripts/cron/mbox-archive-job.sh
deleted file mode 100755
index 6474a1d0..00000000
--- a/scripts/cron/mbox-archive-job.sh
+++ /dev/null
@@ -1,31 +0,0 @@
-#!/bin/sh -eux
-LOG_FILE="$(mktemp)"
-{
- finish() {
- status=$?
- if [ $status = 0 ]; then
- STATUS="✅ SUCCESS (status $status)"
- else
- STATUS="❌ FAILURE (status $status)"
- fi
-
- echo "Registering status locally..."
- set -x
- printf '%s mbox-archive\n' "$status" >> "/tmp/cron-dbg.summary.$(date -I).euandreh.log"
-
- echo "Sending report email..."
-
- SUBJECT="Job report on $(hostname): ${STATUS} for mbox-archive-job.sh"
- gpg -easr eu@euandre.org < "$LOG_FILE" | \
- mail eu@euandre.org \
- -s "$SUBJECT" \
- -a 'From:eu@euandre.org' \
- --content-type 'text/plain; charset=utf-8'
- echo 'Mail sent!'
- }
- trap finish EXIT
-
- echo "Starting: $(date -Is)"
- ~/dev/libre/dotfiles/scripts/ad-hoc/mbox-archive.sh
- echo "Finishing: $(date -Is)"
-} | tee "$LOG_FILE" 2>&1
diff --git a/scripts/cron/mr-remotes-backup-job.sh b/scripts/cron/mr-remotes-backup-job.sh
deleted file mode 100755
index d2cca9b4..00000000
--- a/scripts/cron/mr-remotes-backup-job.sh
+++ /dev/null
@@ -1,31 +0,0 @@
-#!/bin/sh -eux
-LOG_FILE="$(mktemp)"
-{
- finish() {
- status=$?
- if [ $status = 0 ]; then
- STATUS="✅ SUCCESS (status $status)"
- else
- STATUS="❌ FAILURE (status $status)"
- fi
-
- echo "Registering status locally..."
- set -x
- printf '%s mr-remotes-backup\n' "$status" >> "/tmp/cron-dbg.summary.$(date -I).euandreh.log"
-
- echo "Sending report email..."
-
- SUBJECT="Job report on $(hostname): ${STATUS} for mr-remotes-backup-job.sh"
- gpg -easr eu@euandre.org < "$LOG_FILE" | \
- mail eu@euandre.org \
- -s "$SUBJECT" \
- -a 'From:eu@euandre.org' \
- --content-type 'text/plain; charset=utf-8'
- echo 'Mail sent!'
- }
- trap finish EXIT
-
- echo "Starting: $(date -Is)"
- ~/dev/libre/dotfiles/scripts/ad-hoc/mr-remotes-backup.sh
- echo "Finishing: $(date -Is)"
-} | tee "$LOG_FILE" 2>&1
diff --git a/scripts/cron/notmuch-dump-job.sh b/scripts/cron/notmuch-dump-job.sh
deleted file mode 100755
index 1c32eb6c..00000000
--- a/scripts/cron/notmuch-dump-job.sh
+++ /dev/null
@@ -1,31 +0,0 @@
-#!/bin/sh -eux
-LOG_FILE="$(mktemp)"
-{
- finish() {
- status=$?
- if [ $status = 0 ]; then
- STATUS="✅ SUCCESS (status $status)"
- else
- STATUS="❌ FAILURE (status $status)"
- fi
-
- echo "Registering status locally..."
- set -x
- printf '%s notmuch-dump\n' "$status" >> "/tmp/cron-dbg.summary.$(date -I).euandreh.log"
-
- echo "Sending report email..."
-
- SUBJECT="Job report on $(hostname): ${STATUS} for notmuch-dump-job.sh"
- gpg -easr eu@euandre.org < "$LOG_FILE" | \
- mail eu@euandre.org \
- -s "$SUBJECT" \
- -a 'From:eu@euandre.org' \
- --content-type 'text/plain; charset=utf-8'
- echo 'Mail sent!'
- }
- trap finish EXIT
-
- echo "Starting: $(date -Is)"
- ~/dev/libre/dotfiles/scripts/ad-hoc/notmuch-dump.sh
- echo "Finishing: $(date -Is)"
-} | tee "$LOG_FILE" 2>&1
diff --git a/scripts/cron/repo-update-job.sh b/scripts/cron/repo-update-job.sh
deleted file mode 100755
index 8c7eaa06..00000000
--- a/scripts/cron/repo-update-job.sh
+++ /dev/null
@@ -1,31 +0,0 @@
-#!/bin/sh -eux
-LOG_FILE="$(mktemp)"
-{
- finish() {
- status=$?
- if [ $status = 0 ]; then
- STATUS="✅ SUCCESS (status $status)"
- else
- STATUS="❌ FAILURE (status $status)"
- fi
-
- echo "Registering status locally..."
- set -x
- printf '%s repo-update\n' "$status" >> "/tmp/cron-dbg.summary.$(date -I).euandreh.log"
-
- echo "Sending report email..."
-
- SUBJECT="Job report on $(hostname): ${STATUS} for repo-update-job.sh"
- gpg -easr eu@euandre.org < "$LOG_FILE" | \
- mail eu@euandre.org \
- -s "$SUBJECT" \
- -a 'From:eu@euandre.org' \
- --content-type 'text/plain; charset=utf-8'
- echo 'Mail sent!'
- }
- trap finish EXIT
-
- echo "Starting: $(date -Is)"
- ~/dev/libre/dotfiles/scripts/ad-hoc/repo-update.sh
- echo "Finishing: $(date -Is)"
-} | tee "$LOG_FILE" 2>&1
diff --git a/scripts/cron/report-summary-job.sh b/scripts/cron/report-summary-job.sh
deleted file mode 100755
index 9ee4fbf3..00000000
--- a/scripts/cron/report-summary-job.sh
+++ /dev/null
@@ -1,31 +0,0 @@
-#!/bin/sh -eux
-LOG_FILE="$(mktemp)"
-{
- finish() {
- status=$?
- if [ $status = 0 ]; then
- STATUS="✅ SUCCESS (status $status)"
- else
- STATUS="❌ FAILURE (status $status)"
- fi
-
- echo "Registering status locally..."
- set -x
- printf '%s report-summary\n' "$status" >> "/tmp/cron-dbg.summary.$(date -I).euandreh.log"
-
- echo "Sending report email..."
-
- SUBJECT="Job report on $(hostname): ${STATUS} for report-summary-job.sh"
- gpg -easr eu@euandre.org < "$LOG_FILE" | \
- mail eu@euandre.org \
- -s "$SUBJECT" \
- -a 'From:eu@euandre.org' \
- --content-type 'text/plain; charset=utf-8'
- echo 'Mail sent!'
- }
- trap finish EXIT
-
- echo "Starting: $(date -Is)"
- ~/dev/libre/dotfiles/scripts/ad-hoc/report-summary.sh
- echo "Finishing: $(date -Is)"
-} | tee "$LOG_FILE" 2>&1
diff --git a/scripts/cron/sync-mail.sh b/scripts/cron/sync-mail.sh
deleted file mode 100755
index 2726cf9e..00000000
--- a/scripts/cron/sync-mail.sh
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/bin/sh -eu
-
-echo "Starting: $(date -Is)"
-
-FAST_RUN="${1:-}"
-
-if [ "${FAST_RUN}" = "--fast" ]; then
- echo 'Doing fast run'
- mbsync EuAndreh
- notmuch new
-else
- echo 'Doing normal (slow) run'
- notmuch new
- mbsync EuAndreh &
- mbsync Nubank &
- mbsync Gmail &
- wait
- notmuch new
-fi
-
-echo "Finishing: $(date -Is)"