<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Backitup]]></title><description><![CDATA[<p dir="auto">Hallo Zusammen. Ich hab folgende Frage. Wie und was kann man einstellen, damit das Datum des letzten Backups in VIS die Farbe ändern kann. Bei mir wird ein automatisches Backup jede 10 Tage erstellt bzw. soll erstellt werden. Ich hätte gern, das das Datum des letzten Backups innerhalb der nächsten 10 Tagen in grüner Farbe angezeigt wird, und danach in rot (falls kein Backup aus irgendwelchen Gründen erstellt wurde). Hat jemand eine Idee? Vielen Dank im Voraus!<br />
Gruß. Alex</p>
]]></description><link>https://forum.iobroker.net/topic/27421/backitup</link><generator>RSS for Node</generator><lastBuildDate>Mon, 13 Apr 2026 02:02:37 GMT</lastBuildDate><atom:link href="https://forum.iobroker.net/topic/27421.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 06 Dec 2019 14:26:50 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Backitup on Fri, 06 Dec 2019 21:34:30 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/mic" aria-label="Profile: Mic">@<bdi>Mic</bdi></a><br />
Ich hab jetzt mal ein bisschen rumgespielt und versucht folgendes als Bining zu machen:</p>
<pre><code>{ats:new Date().getTime(); lb:backitup.0.history.minimalSuccess.ts; lb + 864000000000 &gt; ats? "green" : "red"}
</code></pre>
<p dir="auto">Aber das Problem ist dass ich im Binding kein Ergebnis aus 'new Date().getTime()' bekomme, somit kann ich auch nicht damit rechnen</p>
]]></description><link>https://forum.iobroker.net/post/336063</link><guid isPermaLink="true">https://forum.iobroker.net/post/336063</guid><dc:creator><![CDATA[Peoples]]></dc:creator><pubDate>Fri, 06 Dec 2019 21:34:30 GMT</pubDate></item><item><title><![CDATA[Reply to Backitup on Fri, 06 Dec 2019 20:04:40 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/mic" aria-label="Profile: Mic">@<bdi>Mic</bdi></a><br />
funzt prima, vielen Dank!</p>
]]></description><link>https://forum.iobroker.net/post/336005</link><guid isPermaLink="true">https://forum.iobroker.net/post/336005</guid><dc:creator><![CDATA[Mizantrop]]></dc:creator><pubDate>Fri, 06 Dec 2019 20:04:40 GMT</pubDate></item><item><title><![CDATA[Reply to Backitup on Fri, 06 Dec 2019 18:55:15 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/peoples" aria-label="Profile: Peoples">@<bdi>Peoples</bdi></a> sagte in <a href="/post/335978">Backitup</a>:</p>
<blockquote>
<p dir="auto">Könnte man auch ohne Script mit einem Binding lösen</p>
</blockquote>
<p dir="auto">Ein längeres Script hat bei mir leider nie funktioniert. Geht das bei dir? Also im Binding Datenpunkt abfragen, Datumsvergleich gegen .ts und Inhaltsprüfung, dann je nach Ergebnis Ausgabe.</p>
]]></description><link>https://forum.iobroker.net/post/335980</link><guid isPermaLink="true">https://forum.iobroker.net/post/335980</guid><dc:creator><![CDATA[Mic]]></dc:creator><pubDate>Fri, 06 Dec 2019 18:55:15 GMT</pubDate></item><item><title><![CDATA[Reply to Backitup on Fri, 06 Dec 2019 18:44:46 GMT]]></title><description><![CDATA[<p dir="auto">Könnte man auch ohne Script mit einem Binding lösen</p>
]]></description><link>https://forum.iobroker.net/post/335978</link><guid isPermaLink="true">https://forum.iobroker.net/post/335978</guid><dc:creator><![CDATA[Peoples]]></dc:creator><pubDate>Fri, 06 Dec 2019 18:44:46 GMT</pubDate></item><item><title><![CDATA[Reply to Backitup on Fri, 06 Dec 2019 18:28:19 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/mizantrop" aria-label="Profile: Mizantrop">@<bdi>Mizantrop</bdi></a><br />
Ok, here you go:</p>
<pre><code>/*********************************************
 * Script: War ioBroker-Backup erfolgreich?
 * In einem Datenpunkt wird angezeigt, ob das Backup des Backup-Adapters erfolgreich war.
 * Hierbei wird geprüft, ob das letzte Backup erfolgreich war und ob es in den letzten X Stunden ausgeführt wurde.
 * 
 * Autor: Mic
 * Version: 0.1
 * Veröffentlicht auch unter: https://forum.iobroker.net/topic/27421/backitup
 ********************************************/

/*******************************************************************************
 * Einstellungen
 ******************************************************************************/

// Welchen Datenpunkt anlegen? Kann man so lassen.
const STATE_ID_SUCCESS =    'javascript.0.VIS.Backup.ioBroker_backup_successful';

// Vor weniger als wie vielen Stunden muss das Backup durchgeführt worden sein?
// Hier genügend Puffer hinzufügen, etwa jeweils 24 für einen Tag hinzufügen.
// D.h. bei Backup jeden Tag = 48 (2 Tage), jede Woche = 192 (8 Tage).
const M_HOURS = 48;

// Wie oft soll der Backup-Adapter geprüft und Datenpunkte aktualisiert werden?
// 1 mal pro Tag reicht, man macht ja i.d.R. nicht mehrfach am Tag Backups mit dem Adapter.
const M_CRON = '10 5 * * *' // Um 05:10 jeden Tag



/*******************************************************************************
 * Ab hier nichts mehr ändern / Stop editing here!
 ******************************************************************************/

init();
function init() {
 
    // Create state and call main() once created.
    createState(STATE_ID_SUCCESS, {'name':'Was ioBroker Backup successful and within last 2 days?', 'type':'boolean', 'read':true, 'write':false, 'role':'state', 'def':false }, function() {
        main();
    });

}


function main() {

    // Update initially
    updateVisState(); 

    // Execute on every day at 5:00 in the morning
    schedule(M_CRON, function () {
        updateVisState();
    });

    // -- We don't really need this, is more for testing...
    // Execute once a minimal backup was performed
    on({id: 'backitup.0.history.iobrokerSuccess', change: 'any'}, function(obj) {
        updateVisState();
    });

}

function updateVisState() {
    let result = backupWithinLastXHours(M_HOURS);
    setState(STATE_ID_SUCCESS, result);
}


/**
 * Check if last backup was successful and occurred within last x hours
 * @param {number} hours   Number of hours to check
 * @return {boolean}       True if successful and within last x hours, false otherwise.
 */
function backupWithinLastXHours(hours) {

    if(! getState('backitup.0.history.iobrokerSuccess').val) {
        log('Letztes ioBroker-Backup war nicht erfolgreich!', 'warn');
        return false;
    }

    // Last Backup date
    let tsLastBackup = getState('backitup.0.history.iobrokerSuccess').ts;

    // Now
    let dtNow = new Date();
    let tsNow = dtNow.getTime();

    // Difference
    let diff = Math.round((tsNow - tsLastBackup) / 1000 / 60 / 60); // Zeitdifferenz in Stunden

    if (diff &gt; hours) {
        log('Letztes ioBroker-Backup war vor länger als ' + hours + ' Stunden', 'warn');
        return false;
    } else {
        log('Letztes ioBroker-Backup war erfolgreich');
        return true;
    }

}



</code></pre>
]]></description><link>https://forum.iobroker.net/post/335971</link><guid isPermaLink="true">https://forum.iobroker.net/post/335971</guid><dc:creator><![CDATA[Mic]]></dc:creator><pubDate>Fri, 06 Dec 2019 18:28:19 GMT</pubDate></item><item><title><![CDATA[Reply to Backitup on Fri, 06 Dec 2019 17:56:19 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/mic" aria-label="Profile: Mic">@<bdi>Mic</bdi></a><br />
Ja, gerne! Genau das, was ich brauche. Danke!</p>
]]></description><link>https://forum.iobroker.net/post/335951</link><guid isPermaLink="true">https://forum.iobroker.net/post/335951</guid><dc:creator><![CDATA[Mizantrop]]></dc:creator><pubDate>Fri, 06 Dec 2019 17:56:19 GMT</pubDate></item><item><title><![CDATA[Reply to Backitup on Fri, 06 Dec 2019 17:45:41 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/mizantrop" aria-label="Profile: Mizantrop">@<bdi>Mizantrop</bdi></a><br />
Ich habe ein Script, das jeden Tag prüft, ob (a) das letzte Backup erfolgreich war, und (b) ob das letzte Backup innerhalb von X Tagen ausgeführt wurde. Als Ergebnis wird ein Datenpunkt unter javascript.0.... gesetzt mit true/false. Hilft dir das? Dann sag Bescheid, dann kann ich gerne das JavaScript posten.</p>
]]></description><link>https://forum.iobroker.net/post/335944</link><guid isPermaLink="true">https://forum.iobroker.net/post/335944</guid><dc:creator><![CDATA[Mic]]></dc:creator><pubDate>Fri, 06 Dec 2019 17:45:41 GMT</pubDate></item></channel></rss>