Skip to main content

Thread: Scripting help... Need to copy every 5th time


so i'm using command line utility "webcam" save frames camera folder in /var/www remote viewing, want save frames. files range 2k 20k. 1 frame per second saved. have following script running camera.
code:
#!/bin/sh  webcam /etc/cam/webcamrc & # saves 1 frame per second  while :   	convert /var/www/[redacted]/outdoor.jpg -resize 50% /var/www/[redacted]/outdoor_sm.jpg #smaller, 320x240 copy  	if [ ! -d "/home/[redacted]/security/$(date +%y)/$(date +%m)/$(date +%d)/$(date +%h)" ]  	then  	       mkdir -p /home/[redacted]/security/$(date +%y)/$(date +%m)/$(date +%d)/$(date +%h) #copy folder year/month/day/hour if exists, otherwise make  	fi  	cp /var/www/[redacted]/outdoor_sm.jpg /home/[redacted]/security/$(date +%y)/$(date +%m)/$(date +%d)/$(date +%h)/outdoor-$(date +%y.%m.%d.%h.%m.%s).jpg #and make sure it's named year.month.day.hour.minute.second.jpg  	sleep 0.75 #this takes 250ms on system sleep rest of second  done
now great man these files stack up. day directory ranges 500 1000mb. so, want modify script save every nth frame taken. preferably 5th. security reasons. maybe 1 every 20 seconds. knows. how go doing that? thinking loop somehow can't seem make work.

would work?:
code:
count=0 while true   stuff every time   let count++   if [[ $count -eq 5 ]]       stuff every fifth time     count=0   fi done


Forum The Ubuntu Forum Community Ubuntu Official Flavours Support General Help [SOLVED] Scripting help... Need to copy every 5th time


Ubuntu

Comments

Popular posts from this blog

Falang and too many redirects - Joomla! Forum - community, help and support

Infinite loop detected in JErrorInfinite loop detected in JError - Joomla! Forum - community, help and support

logged out from joomla! - Joomla! Forum - community, help and support