Hallo Freunde,
ich möchte gerne das Datum des letzten montages ermitteln.
Ich habe einen server an dem ich jeden Montag das log der letzten woche runterladen muss.
Und möchte dies gerne automatisieren.
Die download URL beinhaltet das Datum als zahlen.
http://xxx.xxx.xxx.xxx/traceData.cgi?MACHINE=+--&LAYOUT=+--&STARTTIME=FROM&STARTYEAR=$startyearmydatatrace&STARTMONTH=$startmonthmydatatrace&STARTDAY=$startdaymydatatrace&STARTHOURMIN=0000&STOPTIME=ALL&STOPYEAR=$aktuellesjahr.aktuellesjahr&STOPMONTH=$aktuellermonat.aktuellermonat&STOPDAY=$aktuellertag.aktuellertag&90PHOURMIN=2359&FLYT=Yes&FLOT=Yes&FSTA=Yes&FSTP=Yes&FPCB=Yes&FPNM=Yes&FPID=Yes&FLIN=Yes&HEADER=No&DOWNLOAD=Yes&REPORT=Bericht+generieren&FORMAT=TAB\
Hier bereits mit variablen ausgefüllt. erklären sich eigentlich von selbst.
Diese Regel triggere ich wenn, der server montags angeht.
{
"id": "mydatatracelog-letzte-kw-auto",
"name": "mydatatracelog letzte kw auto",
"rule": "when its monday and MyServer is present for 15 minutes then execute \"curl -sS --silent \\\"http://xxx.xxx.xxx.xxx/traceData.cgi?MACHINE=+--&LAYOUT=+--&STARTTIME=FROM&STARTYEAR=$startyearmydatatrace&STARTMONTH=$startmonthmydatatrace&STARTDAY=$startdaymydatatrace&STARTHOURMIN=0000&STOPTIME=ALL&STOPYEAR=$aktuellesjahr.aktuellesjahr&STOPMONTH=$aktuellermonat.aktuellermonat&STOPDAY=$aktuellertag.aktuellertag&90PHOURMIN=2359&FLYT=Yes&FLOT=Yes&FSTA=Yes&FSTP=Yes&FPCB=Yes&FPNM=Yes&FPID=Yes&FLIN=Yes&HEADER=No&DOWNLOAD=Yes&REPORT=Bericht+generieren&FORMAT=TAB\\\" >> /media/mydatatraceability/mydatatraceKW$letztewoche.txt\"",
"active": true,
"logging": true
}
Das aktuelle datum kann man ja per shellsensor und der “date” funktion ermitteln.
Wie kriege ich nun hin, das er genau weiß das er von montag bis montag zu nehmen hat? Und nicht das aktuelle datum -7?
Zum Beispiel, wenn die arbeitswoche erst dienstag beginnt?
(lässt sich per ping presence wahrscheinlich am einfachsten feststellen)
(Server wasn’t present on monday)?
mfg
Chris
english:
Hello friends,
I would like to determine the date of the last montages.
I have a server where I have to download the log of the last week every Monday.
And this would like to automate.
The download URL contains the date as charged
see above
Here already filled with variable. explain almost without saying.
This rule I triggere if that addresses server Mondays.
see above
The current date one can determine via shell sensor and the “date” function.
How do I get now therefore, and he knows that he has to take from Monday to Monday? And not the current date -7?
For example, if the working week until Tuesday begins?
(Can be via ping presence probably easiest notice)
(Server what not present on monday)?
mfg
Chris