diff options
| author | thomas grothe <grothe.tr@gmail.com> | 2023-10-31 09:43:27 -0500 |
|---|---|---|
| committer | thomas grothe <grothe.tr@gmail.com> | 2023-10-31 09:43:27 -0500 |
| commit | 87544d9583a91529a7c5c1816dc1a06eabaf7cd0 (patch) | |
| tree | 82dcb4d32d8643b8d8031947c4cdef61c78b6dd7 | |
| parent | b514920271a2a94490ef84f7805a7e31122373b2 (diff) | |
update capture script
| -rwxr-xr-x | capture.sh | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -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 |
