summaryrefslogtreecommitdiff
path: root/takepix.sh
diff options
context:
space:
mode:
authorst33v <github@f3rr3t.com>2017-01-14 15:26:57 +1100
committerst33v <github@f3rr3t.com>2017-01-14 15:26:57 +1100
commit0df9a91db4dd190a47371eba53556713214d1f43 (patch)
tree142af62de0ca0d0ea283ddc3c8228ef0fe3d2dfe /takepix.sh
parent26bd74123ad21ccc560e496b9f1e3e9eb3e4a1b9 (diff)
now PUSHES pix to stan rather than waiting for them to be collected
Diffstat (limited to 'takepix.sh')
-rwxr-xr-xtakepix.sh19
1 files changed, 15 insertions, 4 deletions
diff --git a/takepix.sh b/takepix.sh
index db05b9f..6a602b0 100755
--- a/takepix.sh
+++ b/takepix.sh
@@ -1,12 +1,19 @@
#!/bin/bash
-
-# define variables. Your needs may vary.
-# use literal user name. Shell expansions may not work when this script is run by a service!
-picdir="/home/st33v/pix"
+# takepix.sh SJP 10 January 2017
+# Version 2: PUSH photos to STAN rather than waiting for STAN to pull them by scp.
+#
+# Create a file called 'picdir.config', containing paths to your local photos and
+# the storage location on your equivalent of STAN, or 'cam Herder' raspi. It must overwrite
+# the following variable assignments, which are shown as examples:
+# use literal user name. Shell expansions may not work when this script is run by a service!
+picdir="/path/to/my/photos" # overwritten by sourcing from .picdir.config
+camHerder="STAN:/home/path/to/stored/photos"
+. picdir.config # source directory name from local config file
picdate=$(date +%Y-%m-%d_%H%M)
thispic=$picdir/$picdate.jpg
artist=$(hostname)
jpgQuality="90"
+camHerderHostname='stan' # Substitute your cam 'controller' hostname or LAN IP address
# echo thispic = $thispic
@@ -23,6 +30,10 @@ case ${artist^^} in
esac
+# Copy pic to STAN, and place it in proper subdirectory (which of course must exist on STAN).
+scp $thispic $camHerder/$artist/.
+rm $thispic
+
# Note: we do no image processing on this pi, because it has so little RAM
# left after devoting 128MB to the GPU (camera).
# STAN does all the heavy lifting: