{
  "code_name": "csv_backup",
  "unique_prefix": "CSVBCKP",
  "plugin_type": "system",
  "enabled": true,
  "data_source": "script",  
  "show_ui": false,
  "localized": ["display_name", "description", "icon"],

  "display_name": [
    {
      "language_code": "en_us",
      "string": "CSV backup"
    },
    {
      "language_code": "es_es",
      "string": "Backup CSV"
    },
    {
      "language_code": "de_de",
      "string": "CSV-Sicherung"
    }    
  ],
  "icon": [
    {
      "language_code": "en_us",
      "string": "<i class=\"fa-solid fa-save\"></i>"
    }
  ],
  "description": [
    {
      "language_code": "en_us",
      "string": "A plugin to auto-generate devices.csv backups."
    },
    {
      "language_code": "es_es",
      "string": "Un Plugin para generar automáticamente copias de seguridad de devices.csv."
    },
    {
      "language_code": "de_de",
      "string": "Ein Plugin zum automatischen Generieren von devices.csv-Backups."
    }	    
  ],
    "params" : [{
      "name"  : "overwrite",
      "type"  : "setting",
      "value" : "CSVBCKP_overwrite"
    },
    {
      "name"  : "location",
      "type"  : "setting",
      "value" : "CSVBCKP_location"
    }
  ],  

  "settings": [
    {
      "function": "RUN",      
      "events": ["run"],      
      "type": "text.select",            
      "default_value":"schedule",
      "options": ["disabled", "once", "schedule", "always_after_scan", "on_new_device"],
      "localized": ["name", "description"],
      "name" :[{
          "language_code":"en_us",
          "string" : "When to run"
      },
      {
          "language_code":"es_es",
          "string" : "Cuándo ejecutar"
      },
      {
          "language_code":"de_de",
          "string" : "Wann laufen"
      }],
      "description": [{
          "language_code":"en_us",
          "string" : "When the backup should be created. A daily or weekly <code>SCHEDULE</code> is a good option."
      },
      {
          "language_code":"es_es",
          "string" : "Cuándo se debe crear la copia de seguridad. Un <code>SCHEDULE</code> diario o semanal es una buena opción."
      },
      {
          "language_code":"de_de",
          "string" : "Wann das Backup erstellt werden soll. Ein täglicher oder wöchentlicher <code>SCHEDULE</code> ist eine gute Option."
      }]
  },    
    {
      "function": "CMD",
      "type": "readonly",
      "default_value": "python3 /app/front/plugins/csv_backup/script.py overwrite={overwrite} location={location}",
      "options": [],
      "localized": ["name", "description"],
      "name": [
        {
          "language_code": "en_us",
          "string": "Command"
        },
        {
          "language_code": "es_es",
          "string": "Comando"
        },
        {
          "language_code": "de_de",
          "string": "Befehl"
        }	        
      ],
      "description": [
        {
          "language_code": "en_us",
          "string": "Command to run. This can not be changed"
        },
        {
          "language_code": "es_es",
          "string": "Comando a ejecutar. Esto no se puede cambiar"
        },
        {
          "language_code": "de_de",
          "string": "Befehl zum Ausführen. Dies kann nicht geändert werden"
        }	        
      ]
    },
    {
      "function": "RUN_SCHD",
      "type": "text",
      "default_value":"0 2 * * 3",
      "options": [],
      "localized": ["name", "description"],
      "name" : [{
          "language_code":"en_us",
          "string" : "Schedule"
      },
      {
          "language_code":"es_es",
          "string" : "Schedule"
      },
      {
          "language_code":"de_de",
          "string" : "Schedule"
      }],
      "description": [{
          "language_code":"en_us",
          "string" : "Only enabled if you select <code>schedule</code> in the <a href=\"#CSVBCKP_RUN\"><code>CSVBCKP_RUN</code> setting</a>. Make sure you enter the schedule in the correct cron-like format (e.g. validate at <a href=\"https://crontab.guru/\" target=\"_blank\">crontab.guru</a>). For example entering <code>0 4 * * *</code> will run the scan after 4 am in the <a onclick=\"toggleAllSettings()\" href=\"#TIMEZONE\"><code>TIMEZONE</code> you set above</a>. Will be run NEXT time the time passes."
      },
      {
          "language_code":"es_es",
          "string" : "Solo está habilitado si selecciona <code>schedule</code> en la configuración <a href=\"#CSVBCKP_RUN\"><code>CSVBCKP_RUN</code></a>. Asegúrese de ingresar la programación en el formato similar a cron correcto (por ejemplo, valide en <a href=\"https://crontab.guru/\" target=\"_blank\">crontab.guru</a>). Por ejemplo, ingresar <code>0 4 * * *</code> ejecutará el escaneo después de las 4 a.m. en el <a onclick=\"toggleAllSettings()\" href=\"#TIMEZONE\"><code>TIMEZONE</ código> que configuró arriba</a>. Se ejecutará la PRÓXIMA vez que pase el tiempo."
      },
      {
          "language_code":"de_de",
          "string" : "Nur aktiviert, wenn Sie <code>schedule</code> in der <a href=\"#CSVBCKP_RUN\"><code>CSVBCKP_RUN</code>-Einstellung</a> auswählen. Stellen Sie sicher, dass Sie den Zeitplan im richtigen Cron-ähnlichen Format eingeben (z. B. validieren unter <a href=\"https://crontab.guru/\" target=\"_blank\">crontab.guru</a>). Wenn Sie beispielsweise <code>0 4 * * *</code> eingeben, wird der Scan nach 4 Uhr morgens in der <a onclick=\"toggleAllSettings()\" href=\"#TIMEZONE\"><code>TIMEZONE</ ausgeführt. Code> den Sie oben festgelegt haben</a>. Wird das NÄCHSTE Mal ausgeführt, wenn die Zeit vergeht."
      }]
  },    
    {
      "function": "RUN_TIMEOUT",
      "type": "integer",
      "default_value": 30,
      "options": [],
      "localized": ["name", "description"],
      "name": [
        {
          "language_code": "en_us",
          "string": "Run timeout"
        },
        {
          "language_code": "es_es",
          "string": "Tiempo límite de ejecución"
        },
        {
          "language_code": "de_de",
          "string": "Zeitüberschreitung"
        }	        
      ],
      "description": [
        {
          "language_code": "en_us",
          "string": "Maximum time in seconds to wait for the script to finish. If this time is exceeded the script is aborted."
        },
        {
          "language_code": "es_es",
          "string": "Tiempo máximo en segundos para esperar a que finalice el script. Si se supera este tiempo, el script se cancela."
        },
        {
          "language_code": "de_de",
          "string": "Maximale Zeit in Sekunden, die auf den Abschluss des Skripts gewartet werden soll. Bei Überschreitung dieser Zeit wird das Skript abgebrochen."
        }        
      ]
    },
    {
      "function": "overwrite",
      "type": "boolean",
      "default_value":false,
      "options": [],
      "localized": ["name", "description"],
      "name" : [{
          "language_code":"en_us",
          "string" : "Overwrite file"
      },
      {
          "language_code":"es_es",
          "string" : "Sobrescribir archivo"
      },
      {
          "language_code":"de_de",
          "string" : "Datei überschreiben"
      }],
      "description": [{
          "language_code":"en_us",
          "string" : "If the <code>devices.csv</code> file should be always overwritten. If disabled, the date and time is added to the name."
      },
      {
          "language_code":"es_es",
          "string" : "Si el archivo <code>devices.csv</code> siempre debe sobrescribirse. Si está deshabilitado, la fecha y la hora se agregan al nombre."
      },
      {
          "language_code":"de_de",
          "string" : "Wenn die Datei <code>devices.csv</code> immer überschrieben werden soll. Wenn deaktiviert, werden dem Namen Datum und Uhrzeit hinzugefügt."
      }]
    },
    {
      "function": "location",
      "type": "text",
      "default_value":"/app/config",
      "options": [],
      "localized": ["name", "description"],
      "name" : [{
          "language_code":"en_us",
          "string" : "File location"
      },
      {
          "language_code":"es_es",
          "string" : "Ubicación del archivo"
      },
      {
          "language_code":"de_de",
          "string" : "Speicherort"
      }],
      "description": [{
          "language_code":"en_us",
          "string" : "Where the <code>devices.csv</code> file should be saved. For example <code>/app/config</code>."
      },
      {
          "language_code":"es_es",
          "string" : "Donde se debe guardar el archivo <code>devices.csv</code>. Por ejemplo <code>/app/config</code>."
      },
      {
          "language_code":"de_de",
          "string" : "Wo die Datei <code>devices.csv</code> gespeichert werden soll. Zum Beispiel <code>/app/config</code>."
      }]
  }
  ],

  "database_column_definitions": 
  [          
           
  ]
}
