Garden Cam Gallery Project

0

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:

DATE=$(date +%m%d)
Dir=$(date +%m-%d)

# Move the files
for file in cam-”$DATE”*.jpg; do
mkdir -p “$Dir”
mv $file “$Dir”
done

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)

About Dan

Hey There! My name is Dan. I was born and raised in Vancouver, Washington. I attended Hudson's Bay High School and Clark College. I am married to a beautiful woman named Kelly. I enjoy Computers and History, I am also a life long Pro-Wrestling fan! As of late, I started to create my own version of Jarvis (Yes, the same kind of thing Tony Stark has in The Avengers and Iron Man Movies). Feel free to contact me!


Both comments and pings are currently closed.

Comments are closed.

Twitter Delicious Facebook Digg Stumbleupon Favorites More
64 queries in 1.247 seconds.
Powered by WordPress | New Free WordPress Themes | Thanks to Business Opportunity, WordPress Themes and Premium WordPress Themes