about summary refs log tree commit diff homepage
path: root/snapshot.sh
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2021-09-27 03:02:59 +0000
committerJune McEnroe <june@causal.agency>2021-09-27 03:02:59 +0000
commitb63e50b739279e392ba5742d20e37ef5b5335577 (patch)
treee697bafe880efe85e973f048527ee4775d6cb51f /snapshot.sh
parentExtract chroot.tar with -p, install to WEBROOT (diff)
downloadtorus-b63e50b739279e392ba5742d20e37ef5b5335577.tar.gz
torus-b63e50b739279e392ba5742d20e37ef5b5335577.zip
Copy CSVs to web directory from snapshot.sh
Diffstat (limited to '')
-rwxr-xr-xsnapshot.sh7
1 files changed, 6 insertions, 1 deletions
diff --git a/snapshot.sh b/snapshot.sh
index 6dc44fb..94526e2 100755
--- a/snapshot.sh
+++ b/snapshot.sh
@@ -1,6 +1,11 @@
 #!/bin/sh
-set -e -u
+set -eu
 
 ts=$(date +'%Y.%m.%d.%H.%M')
 gzip -c -9 < "$1/torus.dat" > "$2/torus.dat.$ts.gz"
 $(dirname "$0")/meta < "$1/torus.dat" | gzip -c -9 > "$2/torus.csv.$ts.gz"
+
+if [ $# -gt 2 ]; then
+	cp "$2/torus.csv.$ts.gz" "$3"
+	echo "torus.csv.$ts.gz" > "$3/LATEST"
+fi