diff options
| author | st33v <github@f3rr3t.com> | 2016-09-25 17:29:04 +1000 |
|---|---|---|
| committer | st33v <github@f3rr3t.com> | 2016-09-25 17:29:04 +1000 |
| commit | de06f166ef5d7d3690c72c98e53b99b74595c251 (patch) | |
| tree | b9e699623c7f19f2a15d24b9a25bf53239b96b9f | |
| parent | d83be9c2d2540341051f6e3dc485a822c89f1321 (diff) | |
add sendpix.sh and fixes to getpix timer
| -rwxr-xr-x | getpix.sh | 2 | ||||
| -rw-r--r-- | getpix.timer | 2 | ||||
| -rwxr-xr-x | sendpix.sh | 19 |
3 files changed, 22 insertions, 1 deletions
@@ -8,4 +8,6 @@ campi="neatherd" scp $campi:/home/st33v/pix/*.jpg /home/st33v/cams/$campi/. 2>/dev/null ssh $campi "rm /home/st33v/pix/*.jpg" 2>/dev/null +. ~/cams/sendpix.sh + #exit(0) # force succes exit code for fussy systemd diff --git a/getpix.timer b/getpix.timer index 4f7eec6..f792b72 100644 --- a/getpix.timer +++ b/getpix.timer @@ -4,7 +4,7 @@ Description= check every minute [Timer] Persistent=true OnBootSec=1min -OnCalendar=minutely +OnCalendar=*:0,15,30,45 [Install] WantedBy=timers.target diff --git a/sendpix.sh b/sendpix.sh new file mode 100755 index 0000000..e597d6f --- /dev/null +++ b/sendpix.sh @@ -0,0 +1,19 @@ +#!/usr/bin/bash +# SJP 22 Feb 2016 +# +# Send (copy) webcam pix from master repository (on the LAN) to remote computer with web server. +# This script is to be called from a systemd timer. + +# The name of the system that has the webcamn attached. +# While this is presently hard-coded, we can abstract this for laster iterations when there are more than one cam. +campi="neatherd" +# remote server +wanWebServer="f3rr3t.com" + +# select the most recent pic +newpic=$(ls -t ~/cams/$campi/ | head -1 ) + +scp /home/st33v/cams/$campi/$newpic $wanWebServer:/home/st33v/farm/cam/$campi/. + + +#exit(0) # force succes exit code for fussy systemd |
