[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[no subject]
- <!--x-content-type: text/plain -->
- <!--x-date: Wed Apr 7 22:37:14 2004 -->
- <!--x-from-r13: Dboreg.Z.Vneevf ng eqyt.arg (Dboreg Z. Vneevf) -->
- <!--x-message-id: [email protected] -->
- <!--x-reference: [email protected] -->
- <!--x-reference: [email protected] --> "http://www.w3.org/TR/html4/loose.dtd">
- <!--x-subject: [ale] "motion" and snapshots? -->
- <li><em>date</em>: Wed Apr 7 22:37:14 2004</li>
- <li><em>from</em>: Robert.L.Harris at rdlg.net (Robert L. Harris)</li>
- <li><em>in-reply-to</em>: <<a href="msg00263.html">[email protected]</a>></li>
- <li><em>references</em>: <<a href="msg00257.html">[email protected]</a>> <<a href="msg00263.html">[email protected]</a>></li>
- <li><em>subject</em>: [ale] "motion" and snapshots?</li>
I'll compare yours against mine I wrote while waiting on my freaking
cablemmodem to come up. Helped when I found the "onsave" directive in
the config file.
Thanks for pointing out this proggy, it's great.
Thus spake Geoffrey (esoteric at 3times25.net):
> Robert L. Harris wrote:
> >
> >I know Geoff and a couple others are playing with "motion". I just
> >got a new webcam and it's actually supported. Getting motion up and
> >online was quick and I love the built in web server. So far the only
> >problem I've got is the snapshots are saved in
> ><prefix>/2004/04/08/21/22/snapshot.jpg format instead of somethign
> >like /prefix/200404082122.jpg which makes poking through a history
> >much simpler. Anyone found a way to manage something like this?
>
> I've got a perl script around here that does a conversion like this, let
> me look around...... Ah, here it is! It's ugly, it's old, it uses
> static directory values, feel free to hack away at it. Hope it helps!
>
> --
> Until later, Geoffrey Registered Linux User #108567
> Building secure systems in spite of Microsoft
> #!/usr/bin/perl
>
> # use diagnostics;
> use strict;
>
> my ($nfn, $fn, @parts, %newdir, %newfn, $i, $key, $value, %file, @df, @data);
>
> chdir "/home/esoteric/watch" || die "died attempting to chdir";
>
> my @files = `find . -name '*.jpg' -print`;
>
> printf "files to move: %s\n", $#files + 1;
>
> my @pre_df=`df /home/esoteric/store`;
>
> foreach $fn (@files) {
>
> # parse through each file name, and build the new filename
> # and directory name the file will reside
>
> chomp $fn;
> @parts = split ("/", $fn);
> $file{$fn} = $parts[0];
> $newdir{$fn} = "/home/esoteric/store/archive/" .
> substr($parts[1], 2, 2) . $parts[2] . $parts[3];
> $newfn{$fn} = $parts[4] . $parts[5] . substr($parts[6], 0, 2);
>
> for ($i = 1; $i < $#parts; $i++) {
> $file{$fn} = $file{$fn} . "/" . $parts[$i];
> }
> }
>
> my $count=0;
>
> while (($key, $value) = each %file) { $count++; }
>
> printf "files to move: %s\n", $count;
>
> $count=0;
> while (($key, $value) = each %file) {
>
> # create the directory if it does not exist
>
> if ( ! -d $newdir{$key} ) { mkdir $newdir{$key}; }
>
> # insure unique file names
>
> $nfn=$newdir{$key} . "/" . $newfn{$key} . ".jpg";
>
> while ( -e $nfn ) {
> printf "Found a duplicate <%s> and <%s>\n", $nfn, $newfn{$key};
> print "Changing file name";
> $nfn=$newdir{$key} . "/" . $newfn{$key} . "a.jpg";
> }
>
> # printf "moving %s to %s\n", $key, $nfn;
> `/bin/mv $key $nfn`;
> if ( ! -e $nfn ) { die "file doesn't exist, mv failed\n" }
> # if ( $? != 0 ) {die "mv $key $nfn failed ($?)";}
> $count++;
> }
> print "files moved: $count\n";
>
> # $list=`find * -type d -depth -print`;
> # print "list of directories located: $list\n";
> `find * -type d -depth -print |xargs rmdir`;
>
> @df=`df /home/esoteric/store`;
> @data = split " ", $df[1];
> $data[4] =~ s/%//;
> print $pre_df[1];
> print $df[1];
> if ( $data[4] > 98 ) {
> `/home/esoteric/shl/dosound /home/esoteric/sounds/intercom.au`;
> }
> exit;
> _______________________________________________
> Ale mailing list
> Ale at ale.org
> <a rel="nofollow" href="http://www.ale.org/mailman/listinfo/ale">http://www.ale.org/mailman/listinfo/ale</a>
:wq!
---------------------------------------------------------------------------
Robert L. Harris | GPG Key ID: E344DA3B
@ x-hkp://pgp.mit.edu
DISCLAIMER:
These are MY OPINIONS ALONE. I speak for no-one else.
With Dreams To Be A King First One Should Be A Man
- Manowar
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
</pre>
<!--X-Body-of-Message-End-->
<!--X-MsgBody-End-->
<!--X-Follow-Ups-->
<hr>
<ul><li><strong>Follow-Ups</strong>:
<ul>
<li><strong><a name="00267" href="msg00267.html">[ale] "motion" and snapshots?</a></strong>
<ul><li><em>From:</em> esoteric at 3times25.net (Geoffrey)</li></ul></li>
</ul></li></ul>
<!--X-Follow-Ups-End-->
<!--X-References-->
<ul><li><strong>References</strong>:
<ul>
<li><strong><a name="00257" href="msg00257.html">[ale] "motion" and snapshots?</a></strong>
<ul><li><em>From:</em> Robert.L.Harris at rdlg.net (Robert L. Harris)</li></ul></li>
<li><strong><a name="00263" href="msg00263.html">[ale] "motion" and snapshots?</a></strong>
<ul><li><em>From:</em> esoteric at 3times25.net (Geoffrey)</li></ul></li>
</ul></li></ul>
<!--X-References-End-->
<!--X-BotPNI-->
<ul>
<li>Prev by Date:
<strong><a href="msg00263.html">[ale] "motion" and snapshots?</a></strong>
</li>
<li>Next by Date:
<strong><a href="msg00265.html">[ale] Fwd: O'Reilly Looking for GNOME Hacks</a></strong>
</li>
<li>Previous by thread:
<strong><a href="msg00263.html">[ale] "motion" and snapshots?</a></strong>
</li>
<li>Next by thread:
<strong><a href="msg00267.html">[ale] "motion" and snapshots?</a></strong>
</li>
<li>Index(es):
<ul>
<li><a href="maillist.html#00264"><strong>Date</strong></a></li>
<li><a href="threads.html#00264"><strong>Thread</strong></a></li>
</ul>
</li>
</ul>
<!--X-BotPNI-End-->
<!--X-User-Footer-->
<!--X-User-Footer-End-->
</body>
</html>