cron job tweaks

main
magical 2023-11-30 04:53:50 +00:00
parent 01fda372f3
commit f94d3db5ce
1 changed files with 8 additions and 1 deletions

View File

@ -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