mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-02-28 02:44:53 +00:00
Archiving FileLog completed
git-svn-id: https://svn.fhem.de/fhem/trunk@63 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
443f0de25f
commit
50b1f65f6d
@ -331,3 +331,4 @@
|
|||||||
- bugfix: disabled notify causes "uninitialized value" (STefan, 1.5)
|
- bugfix: disabled notify causes "uninitialized value" (STefan, 1.5)
|
||||||
- bugfix: deleted FS20 items are still logging (zombie) (Gerhard, 16.5)
|
- bugfix: deleted FS20 items are still logging (zombie) (Gerhard, 16.5)
|
||||||
- bugfix: added FS20S8, removed stty_parmrk (Martin, 24.5)
|
- bugfix: added FS20S8, removed stty_parmrk (Martin, 24.5)
|
||||||
|
- feature: added archivedir/archivecmd to the FileLog
|
||||||
|
@ -56,6 +56,7 @@ FileLog_Undef($$)
|
|||||||
return undef;
|
return undef;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Make a directory and its parent directories if needed.
|
||||||
sub
|
sub
|
||||||
HandleArchiving($)
|
HandleArchiving($)
|
||||||
{
|
{
|
||||||
@ -118,10 +119,8 @@ FileLog_Log($$)
|
|||||||
my $max = int(@{$dev->{CHANGED}});
|
my $max = int(@{$dev->{CHANGED}});
|
||||||
for (my $i = 0; $i < $max; $i++) {
|
for (my $i = 0; $i < $max; $i++) {
|
||||||
my $s = $dev->{CHANGED}[$i];
|
my $s = $dev->{CHANGED}[$i];
|
||||||
Log 1, "FL: Checking $n:$s against $re";
|
|
||||||
$s = "" if(!defined($s));
|
$s = "" if(!defined($s));
|
||||||
if($n =~ m/^$re$/ || "$n:$s" =~ m/^$re$/) {
|
if($n =~ m/^$re$/ || "$n:$s" =~ m/^$re$/) {
|
||||||
Log 1, "FL: Logging";
|
|
||||||
my $t = TimeNow();
|
my $t = TimeNow();
|
||||||
$t = $dev->{CHANGETIME}[$i] if(defined($dev->{CHANGETIME}[$i]));
|
$t = $dev->{CHANGETIME}[$i] if(defined($dev->{CHANGETIME}[$i]));
|
||||||
$t =~ s/ /_/; # Makes it easier to parse with gnuplot
|
$t =~ s/ /_/; # Makes it easier to parse with gnuplot
|
||||||
|
@ -94,3 +94,7 @@
|
|||||||
reapplying all the attributes.
|
reapplying all the attributes.
|
||||||
- feature: the "-" character is disallowed in defined names. Use dot (.) or _
|
- feature: the "-" character is disallowed in defined names. Use dot (.) or _
|
||||||
instead. The - is used to separate ranges in the set command.
|
instead. The - is used to separate ranges in the set command.
|
||||||
|
|
||||||
|
- Rudi, Sun May 27 12:51:52 MEST 2007
|
||||||
|
- Archiving FileLogs. Added fhemweb.pl (pgm2) code, to show logs from the
|
||||||
|
archive directory. See the attributes archivedir/archivecmd.
|
||||||
|
@ -229,6 +229,10 @@ split in multiple lines<br><br>
|
|||||||
<br>
|
<br>
|
||||||
Attributes used by all devices:
|
Attributes used by all devices:
|
||||||
<ul>
|
<ul>
|
||||||
|
<a name="comment"></a>
|
||||||
|
<li>comment<br>
|
||||||
|
Add an arbitrary comment.
|
||||||
|
|
||||||
<a name="room"></a>
|
<a name="room"></a>
|
||||||
<li>room<br>
|
<li>room<br>
|
||||||
Filter/group devices. Recognized by web-pgm2 and web-pgm3.
|
Filter/group devices. Recognized by web-pgm2 and web-pgm3.
|
||||||
@ -243,8 +247,22 @@ split in multiple lines<br><br>
|
|||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
Attributes used by selected devices:
|
Attributes used by some device types:
|
||||||
<ul>
|
<ul>
|
||||||
|
<a name="archivedir"></a> <a name="archivecmd"></a> <a name="nrarchive"></a>
|
||||||
|
<li>archivecmd / archivedir / nrarchive<br>
|
||||||
|
Can be applied to FileLog devices.<br>
|
||||||
|
Before a new FileLog file is opened, the FileLog archiver wil be called.
|
||||||
|
<br>
|
||||||
|
|
||||||
|
If the attribute archivecmd is specified, then it will be started as a
|
||||||
|
shell command (no enclosing " is needed), and each % in the command
|
||||||
|
will be replaced with the name of the old logfile.<br>
|
||||||
|
|
||||||
|
If this attribute is not set, but nrarchive and/or archivecmd is set,
|
||||||
|
then all superfluous logfiles will be moved to archivedir (or deleted if
|
||||||
|
archivedir is not set).</li><br>
|
||||||
|
|
||||||
<a name="disable"></a>
|
<a name="disable"></a>
|
||||||
<li>disable<br>
|
<li>disable<br>
|
||||||
Can be applied to at/notify/FileLog devices.<br>
|
Can be applied to at/notify/FileLog devices.<br>
|
||||||
|
@ -134,7 +134,7 @@ my %intAt; # Internal at timer hash.
|
|||||||
my $intAtCnt=0;
|
my $intAtCnt=0;
|
||||||
my $init_done = 0;
|
my $init_done = 0;
|
||||||
my $reread_active = 0;
|
my $reread_active = 0;
|
||||||
my $AttrList = "room";
|
my $AttrList = "room comment";
|
||||||
|
|
||||||
|
|
||||||
$modules{_internal_}{ORDER} = -1;
|
$modules{_internal_}{ORDER} = -1;
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#Sat May 19 18:46:13 2007
|
#Sun May 27 10:25:14 2007
|
||||||
setstate FHZ fhtbuf: 1c
|
setstate FHZ fhtbuf: 1c
|
||||||
setstate FHZ 2006-02-12 14:03:39 fhtbuf 23
|
setstate FHZ 2006-02-12 14:03:39 fhtbuf 23
|
||||||
setstate FHZ 2006-03-26 08:47:36 init2 deadbeefdeadbe
|
setstate FHZ 2006-03-26 08:47:36 init2 deadbeefdeadbe
|
||||||
|
Loading…
x
Reference in New Issue
Block a user