# Usage: nfg_run_daily_jobs.sh arg1
# Input: arg1: path to directory containing ninfacyzga-1 repository
# Note: Run this script daily at midnight using `cron`.
+# Depends: GNU Coreutils
-nfg_base_dir="../";
+script_path="$(dirname "$(realpath -s "$0")")"; # Get script dir Ref/Attrib: https://stackoverflowcom/questions/4774054/
+nfg_base_dir="$script_path/../";
nfg_exec_dir="$nfg_base_dir"/exec;
length_day_s=$((24 * 60 * 60)); # seconds
# Location
# Photograph
-photo_script_path="$nfg_exec_dir"/update_temp_photograph.sh;
+photo_script_path="$nfg_exec_dir"/photograph/update_temp_photograph.sh;
camera_name="DC1";
timeout "$length_day_s"s /bin/bash "$photo_script_path" "$camera_name" &
iso_date="$(date +%Y%m%dT%H%M%S%z)";
#iso_date_ns="$(date +%Y%m%dT%H%M%S.%N%z)";
device_hostname="$(hostname)";
-nfg_base_dir="../../"; # root directory of ninfacyzga-1 git repo
+
+script_path="$(dirname "$(realpath -s "$0")")"; # Get script dir Ref/Attrib: https://stackoverflowcom/questions/4774054/
+nfg_base_dir="$script_path/../../"; # root directory of ninfacyzga-1 git repo
nfg_unitproc_path="$nfg_base_dir"/exec/unitproc;
sleep_rand_path="$nfg_base_dir"/exec/unitproc/sleepRand.py;
PATH="$nfg_unitproc_path:$PATH"; # include unitprocess nfg executables