From 8115ca3220d4c8e3d727ba7a9732f26511005160 Mon Sep 17 00:00:00 2001 From: henk Date: Thu, 2 Jan 2025 20:41:47 +0100 Subject: [PATCH] 2025-01-02 20:41:47 --- virtualisatie/proxmox/next-id.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100755 virtualisatie/proxmox/next-id.sh diff --git a/virtualisatie/proxmox/next-id.sh b/virtualisatie/proxmox/next-id.sh new file mode 100755 index 0000000..3909ca0 --- /dev/null +++ b/virtualisatie/proxmox/next-id.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +# This modifyr´s the datacenter.cfg +# set the upper limit to upper=70000000 + +# mkdir -p /root/backup + +cp /etc/pve/datacenter.cfg /root/backup/ +/usr/bin/sed -ri "s/lower=[12][0-9]{3}[01][0-9][0-3][0-9]/lower=$(date '+%y%m%d'01)/g" /etc/pve/datacenter.cfg + + +# thas adds the date + 01 +# example 25010201 is the next id for the ct or vm + +# set this in the crontab +# 01 00 * * * /root/next-id.sh