From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 4787865670 for ; Tue, 3 Nov 2020 15:28:52 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 44CB02D725 for ; Tue, 3 Nov 2020 15:28:52 +0100 (CET) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [212.186.127.180]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS id 4CDDF2D599 for ; Tue, 3 Nov 2020 15:28:49 +0100 (CET) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 17D0F45F1B for ; Tue, 3 Nov 2020 15:28:49 +0100 (CET) From: Fabian Ebner To: pbs-devel@lists.proxmox.com Date: Tue, 3 Nov 2020 15:28:41 +0100 Message-Id: <20201103142842.17346-1-f.ebner@proxmox.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL -0.030 Adjusted score from AWL reputation of From: address KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [field.name, wikipedia.org] Subject: [pbs-devel] [PATCH v3 proxmox-backup 1/2] create prune simulator X-BeenThere: pbs-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Backup Server development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Nov 2020 14:28:52 -0000 A stand-alone ExtJS app that allows experimenting with different backup schedules and prune parameters. The HTML for the documentation was taken from the PBS docs and adapted to the context of the simulator. For performance reasons, the week table does not use subcomponents, but raw HTML. Signed-off-by: Fabian Ebner --- Changes from v2: * add explanation/documentation for usage * add titles to components * improve layout * fix and extend schedule parsing: now '..' is supported and '/' behaves as it should * don't allow custom input in the weekdays combobox * add schedule example with range * make initial prune options more realistic * disable the sorting menu on the grid: trying to sort would cause everything to freeze when there were more than a few backups and backups are already sorted anyways * don't track link to extjs with git; add it with dh_link instead, which is how it's done for the PVE api-viewer as well (part of the next patch) docs/prune-simulator/documentation.html | 73 +++ docs/prune-simulator/index.html | 13 + docs/prune-simulator/prune-simulator.js | 755 ++++++++++++++++++++++++ 3 files changed, 841 insertions(+) create mode 100644 docs/prune-simulator/documentation.html create mode 100644 docs/prune-simulator/index.html create mode 100644 docs/prune-simulator/prune-simulator.js diff --git a/docs/prune-simulator/documentation.html b/docs/prune-simulator/documentation.html new file mode 100644 index 00000000..2bd90b94 --- /dev/null +++ b/docs/prune-simulator/documentation.html @@ -0,0 +1,73 @@ + + + + + + +

A simulator to experiment with different backup schedules and prune +options.

+ +

Schedule

+

Select weekdays with the combobox and input hour and minute +specification separated by a colon, i.e. HOUR:MINUTE. Each of +HOUR and MINUTE can be either a single value or +one of the following:

+
    +
  • a comma-separated list: e.g., 01,02,03
  • +
  • a range: e.g., 01..10
  • +
  • a repetition: e.g, 05/10 (means starting at 5 every 10)
  • +
  • a combination of the above: e.g., 01,05..10,12/02
  • +
  • a * for every possible value
  • +
+ +

Pruning

+

Prune lets you systematically delete older backups, retaining backups for +the last given number of time intervals. The following retention options are +available:

+
+
keep-last <N>
+
Keep the last <N> backup snapshots.
+
keep-hourly <N>
+
Keep backups for the last <N> hours. If there is more than one +backup for a single hour, only the latest is kept.
+
keep-daily <N>
+
Keep backups for the last <N> days. If there is more than one +backup for a single day, only the latest is kept.
+
keep-weekly <N>
+
Keep backups for the last <N> weeks. If there is more than one +backup for a single week, only the latest is kept. +
+

Note: Weeks start on Monday and end on Sunday. The software +uses the ISO week date system and handles weeks at +the end of the year correctly.

+
+
+
keep-monthly <N>
+
Keep backups for the last <N> months. If there is more than one +backup for a single month, only the latest is kept.
+
keep-yearly <N>
+
Keep backups for the last <N> years. If there is more than one +backup for a single year, only the latest is kept.
+
+

The retention options are processed in the order given above. Each option +only covers backups within its time period. The next option does not take care +of already covered backups. It will only consider older backups.

+

For example, in a week covered by keep-weekly, one backup is +kept while all others are removed; keep-monthly then does not +consider backups from that week anymore, even if part of the week is part of +an earlier month.

+ + diff --git a/docs/prune-simulator/index.html b/docs/prune-simulator/index.html new file mode 100644 index 00000000..22fa66f6 --- /dev/null +++ b/docs/prune-simulator/index.html @@ -0,0 +1,13 @@ + + + + + + PBS Prune Simulator + + + + + + + diff --git a/docs/prune-simulator/prune-simulator.js b/docs/prune-simulator/prune-simulator.js new file mode 100644 index 00000000..505eb852 --- /dev/null +++ b/docs/prune-simulator/prune-simulator.js @@ -0,0 +1,755 @@ +// avoid errors when running without development tools +if (!Ext.isDefined(Ext.global.console)) { + var console = { + dir: function() {}, + log: function() {}, + }; +} + +Ext.onReady(function() { + const NOW = new Date(); + const COLORS = { + 'keep-last': 'orange', + 'keep-hourly': 'purple', + 'keep-daily': 'yellow', + 'keep-weekly': 'green', + 'keep-monthly': 'blue', + 'keep-yearly': 'red', + 'all zero': 'white', + }; + const TEXT_COLORS = { + 'keep-last': 'black', + 'keep-hourly': 'white', + 'keep-daily': 'black', + 'keep-weekly': 'white', + 'keep-monthly': 'white', + 'keep-yearly': 'white', + 'all zero': 'black', + }; + + Ext.define('PBS.prunesimulator.Documentation', { + extend: 'Ext.Panel', + alias: 'widget.prunesimulatorDocumentation', + + html: '