From 0cc087902e3708a42054882dd3e33ac0b839606a Mon Sep 17 00:00:00 2001 From: weekendatbirneys Date: Sat, 4 May 2024 11:53:12 -0700 Subject: [PATCH] add setup script --- run_fetch.sh | 3 --- setup.sh | 17 +++++++++++++++++ 2 files changed, 17 insertions(+), 3 deletions(-) create mode 100755 setup.sh diff --git a/run_fetch.sh b/run_fetch.sh index c801697..9e66a5d 100755 --- a/run_fetch.sh +++ b/run_fetch.sh @@ -1,7 +1,4 @@ #!/bin/bash -set -a # Automatically export all variables -source .env -set +a # Stop automatically exporting cd $PROBABLES_ROOT_DIR #!/bin/bash NOW=$(date +"%Y-%m-%d %H:%M:%S") diff --git a/setup.sh b/setup.sh new file mode 100755 index 0000000..1a7f84d --- /dev/null +++ b/setup.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +# Set up environment variables or necessary paths +set -a +source .env +set +a + +# setup cronjob +# ┌───────────── min (0 - 59) +# │ ┌────────────── hour (0 - 23) +# │ │ ┌─────────────── day of month (1 - 31) +# │ │ │ ┌──────────────── month (1 - 12) +# │ │ │ │ ┌───────────────── day of week (0 - 7) (Sunday to Saturday; 7 is also Sunday) +# │ │ │ │ │ +# │ │ │ │ │ +SCRIPT_PATH="$PROBABLES_ROOT_DIR"run_fetch.sh +(crontab -l 2>/dev/null; echo "0,30 * * * * $SCRIPT_PATH") | crontab -