From 87544d9583a91529a7c5c1816dc1a06eabaf7cd0 Mon Sep 17 00:00:00 2001 From: thomas grothe Date: Tue, 31 Oct 2023 09:43:27 -0500 Subject: update capture script --- capture.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/capture.sh b/capture.sh index 1043c88..eff84a0 100755 --- a/capture.sh +++ b/capture.sh @@ -2,12 +2,18 @@ #this script repeatedly captures images from a video device (e.g. /dev/video0) at regular intervals #and it compresses images into an .tar.gz after some number and deletes those images #and it deletes old archives after some number have been made +#you can provide a directory in which to save the images if desired MAX_SIZE=1073741824 #1G in bytes TIME_INTERVAL=15 #seconds between taking snapshots THRESHOLD_ARCHIVE=5760 #number of images after which archiving should be done. 5760 is one day if pics are every 15s THRESHOLD_REMOVE=30 #number of image archive tarballs after which a handful of the oldest archives will be deleted +#set the working directory +if [[ ${1} && -d ${1} ]]; then + cd ${1} +fi + while [[ true ]]; do d=`date +%Y%m%d_%H%M%S` snapshot ${d}.png -- cgit v1.2.3