Initial import of verae-keep from zapier monorepo
This commit is contained in:
commit
100a35d589
17 changed files with 1000 additions and 0 deletions
14
scripts/guard.sh
Executable file
14
scripts/guard.sh
Executable file
|
|
@ -0,0 +1,14 @@
|
|||
#!/usr/bin/env bash
|
||||
# Last-resort backup: if watch (and therefore keep) dies, start it again.
|
||||
set -euo pipefail
|
||||
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
|
||||
STATE="${KEEP_STATE:-$ROOT/data}"
|
||||
mkdir -p "$STATE"
|
||||
cd "$ROOT"
|
||||
export KEEP_UNITS="${KEEP_UNITS:-$ROOT/units.json}"
|
||||
export KEEP_STATE="$STATE"
|
||||
while true; do
|
||||
echo "{\"t\":\"$(date -u +%Y-%m-%dT%H:%M:%SZ)\",\"event\":\"guard-start-watch\"}" >>"$STATE/guard.log"
|
||||
node src/watch.js >>"$STATE/guard.out" 2>&1 || true
|
||||
sleep 2
|
||||
done
|
||||
Loading…
Add table
Add a link
Reference in a new issue