From f94d3db5ce16236141d1e0a333b06155bd749680 Mon Sep 17 00:00:00 2001 From: Andrew Ekstedt Date: Thu, 30 Nov 2023 04:53:50 +0000 Subject: [PATCH] cron job tweaks --- cron.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/cron.sh b/cron.sh index 53a7f92..3c3585d 100755 --- a/cron.sh +++ b/cron.sh @@ -1,6 +1,9 @@ #!/bin/bash set -euo pipefail +# install me in your crontab! +# 0 5 1-25 12 * $HOME/adventofcode2023/cron.sh auto + year=2023 root=~/adventofcode${year} @@ -40,7 +43,11 @@ if test -e "$dir"; then exit 1 fi -cwd=${PWD:-`pwd`} +if ! test -e "$root/cookie"; then + echo >&2 "warning: cookiefile '$root/cookie' not found. consider creating it" +fi + +cwd=${PWD:-$(pwd)} mkdir "$dir" cd "$dir" || exit 1