{% extends "base.html" %}
{% import '_ui.html' as ui %}
{% block title %}Clonezilla backups - PXE Manager{% endblock %}
{# Clonezilla backups, grouped by machine number (newest activity first):
image directories saved by the boot menu's "Clonezilla: back up this PC"
(or by hand) and the older machine-number .zip files. One line per
image; its details (disks, Clonezilla version, check) are in the
expandable body; Download is the row's action, Move and Delete are in
the menu and open confirm modals. #}
{% macro gb(n) -%}
{%- if n >= 1e12 %}{{ "%.2f"|format(n / 1e12) }} TB{% elif n >= 1e9 %}{{ "%.1f"|format(n / 1e9) }} GB{% else %}{{ "%.0f"|format(n / 1e6) }} MB{% endif -%}
{%- endmacro %}
{% macro status_chip(i) -%}
{%- if i.status == 'ok' %}{{ ui.chip('Checked', 'ok', 'Clonezilla image check passed' ~ (' ' ~ i.check_date if i.check_date else '')) }}
{%- elif i.status == 'check-failed' %}{{ ui.chip('Check failed', 'fail', 'The image check after saving failed: do not rely on this image') }}
{%- elif i.status == 'failed' %}{{ ui.chip('Save failed', 'fail', 'Clonezilla reported an error while saving: partial image') }}
{%- elif i.status == 'unchecked' %}{{ ui.chip('Not checked', 'warn', 'Saved, but the image check did not run') }}
{%- elif i.status == 'in-progress' %}{{ ui.chip('In progress?', 'run', 'No pxe-meta.txt yet and changed in the last 6 hours: probably still being written') }}
{%- else %}{{ ui.chip('Manual', 'neutral', 'Saved without the PXE menu script: no check result recorded') }}{% endif -%}
{%- endmacro %}
{% block extra_head %}
{% endblock %}
{% block content %}
{% set nmach = groups | rejectattr('machine', 'equalto', '') | list | length %}
{% call ui.head('Clonezilla backups', 'Tools', image_count ~ ' image' ~ ('s' if image_count != 1) ~ ' and ' ~ (backups | length) ~ ' zip' ~ ('s' if backups | length != 1) ~ ' for ' ~ nmach ~ ' machine' ~ ('s' if nmach != 1) ~ ' on the share') %}
Settings
Kept per machine: the {{ plan_keep }} newest images that saved and passed (or skipped) the check. Newer failed or in-progress images are kept too. Images with no machine number are never touched.
The boot menu's Clonezilla: back up this PC asks for the machine number and saves <machine>-<YYYY-MM-DD-HHMM> (for example 6501-2026-10-15-1403) to \\pxe-server\clonezilla, then checks it. Clonezilla: restore this PC lists only that machine's images, newest first.
Images saved by hand (manual mode) are grouped by the start of their folder name; move them to a machine number if they show under No machine number. Uploaded zips are named with the machine number, for example 6501.zip.