Weblog entry #20 for Grimnar
Basic perl/bash help again.
I'm looking for a tiny script to rename one file, and that file is a webcam image that needs to be save every minute or so. That can be done in crontab.
So I'm really searching for the script to take /some/folder/webcam.jpg and make it /some/folder/webcam-TT-DD-YY.jpg
Found some old scripts wich are not working for me, I'm serious the worst bash/perl user ever!
The webcam image updates it self every 5 second. And after a couple of months I will make a time lapse video of my backyard. Pretty neat, eh?
And yeah, I've done a really extensive web search.
Comments on this Entry
mv /some/folder/webcam{,-`date +%F-%T`}.jpg
[ Parent | Reply to this comment ]
FILENAME=/foo/bar.jpg
DATE=$(date +%F_%H%M%S)
mv "$FILENAME" "${FILENAME%.jpg}-${DATE}.jpg"
This examples uses another naming scheme - you will surely need this increased time resolution, as the one you proposed above should not work for updates every minute :)
(additionally: it can be easily sorted by age)
[ Parent | Reply to this comment ]
Thanks again!:)
[ Parent | Reply to this comment ]
[ Parent | Reply to this comment ]
It can do all sorts of interesting stuff with webcams (in addition to taking a simple snapshot every 'n' seconds). It will handle naming the snapshots itself and can even build a movie file on-the-fly.
[ Parent | Reply to this comment ]
[ Parent | Reply to this comment ]
It is gqcam or camorama I think -- my webcam is hiding downstairs or I'd say when, there are probably others.
Someone else may know for sure.
[ Parent | Reply to this comment ]