For awhile now, I’ve had my Garden Cam up and running but I wanted a photo gallery that wasn’t a pain to maintain or setup. I also needed it to auto detect directories and photos. I stumbled across SFPG (Single File Photo Gallery) which does just that!
My only problem was, the webcam only uploads a single image every 5 minutes. My fix? a simple bash script to copy that file into a directory 1 minute after the new image uploads. The image starts at cam_1.jpg but gets transferred with date and time stamps on it for easier sorting with another bash script. Once it’s in the new directory and renamed, it gets sorted:
# Move the files
for file in cam-”$DATE”*.jpg; do
mkdir -p “$Dir”
mv $file “$Dir”
I have the sort script run one minute after the file gets moved, this way I don’t have any issues with the sort script running before the image is moved.
So check it out Gallery
Something you may have caught onto if you read any of my posts, I do things in a round about way. Mainly because I don’t want to have to pay for software to do something if I can make it happen my own way. (prime example: My back up and restore script)
If you want to talk to me about my scripts or want to use them, feel free to contact me! (the ways to contact me are over to the right)