Commit | Line | Data |
---|---|---|
abbcc791 SBS |
1 | #!/bin/bash |
2 | # Desc: A list of executables to be started every day at midnight. | |
3 | # Usage: nfg_run_daily_jobs.sh arg1 | |
4 | # Input: arg1: path to directory containing ninfacyzga-1 repository | |
abbcc791 SBS |
5 | # Note: Run this script daily at midnight using `cron`. |
6 | ||
abbcc791 SBS |
7 | nfg_base_dir="../"; |
8 | nfg_exec_dir="$nfg_base_dir"/exec; | |
9 | length_day_s=$((24 * 60 * 60)); # seconds | |
10 | ||
abbcc791 SBS |
11 | yell() { echo "$0: $*" >&2; } # print script path and all args to stderr |
12 | die() { yell "$*"; exit 111; } # same as yell() but non-zero exit status | |
13 | try() { "$@" || die "cannot $*"; } # runs args as command, reports args if command fails | |
abbcc791 | 14 | |
0e3146f8 | 15 | # Note: Use '&' to run scripts and immediately detach them. |
abbcc791 | 16 | |
0e3146f8 | 17 | # Temperature |
abbcc791 | 18 | |
0e3146f8 | 19 | # Pressure |
abbcc791 | 20 | |
0e3146f8 | 21 | # Location |
abbcc791 | 22 | |
0e3146f8 SBS |
23 | # Photograph |
24 | photo_script_path="$nfg_exec_dir"/update_temp_photograph.sh; | |
25 | camera_name="DC1"; | |
26 | timeout "$length_day_s"s /bin/bash "$photo_script_path" "$camera_name" & |