Scheduled backup running every 3 minutes, not 3 hours

Nov 14, 2022
8
7
8
England
Hi all,

Following the examples given when you set up a backup schedule:

"mon..fri */1:00" means Monday to Friday, hourly, and
"mon..fri 7..18:00/15" means Monday to Friday, every 15 minutes between 0700 and 1800,

I set up the following:

mon..fri 6..21/3:00

Expecting this to run every three hours between 0600 and 2100 on Monday to Friday.

Instead, it is running every three minutes between 0600 and 2100, Monday to Friday.

Changing it to

mon..fri */3:00

does then run every three hours, but for the entire day.

Clearly I am misunderstanding how the scheduler calculates the next run time, but I can't work out what the correct string to use is for what I want. Can anybody help me with this?

For example - looking at the tables on the page https://pve.proxmox.com/pve-docs/pve-admin-guide.html#chapter_calendar_events, I'm even more lost - I know this must be entirely my misunderstanding, but I don't see how:

12/2:5

Means "Every day starting at 12:05 until 22:05, every 2 hours" - if the "12" means "start at 12:00", the "2" means every two hours and the "5" means offset by five minutes (from the text on the page, I don't see why this is an offset), then I don't see why it only runs until 22:05. Surely this should be

12..22:5/2:00

?

Please, somebody, explain this to me like I'm am idiot!


Thank you in advance.

Code:
pveversion -v

proxmox-ve: 8.2.0 (running kernel: 6.5.13-1-pve)
pve-manager: 8.2.9 (running version: 8.2.9/98c7f34632fee424)
proxmox-kernel-helper: 8.1.0
pve-kernel-5.15: 7.4-11
proxmox-kernel-6.8: 6.8.12-4
proxmox-kernel-6.8.12-4-pve-signed: 6.8.12-4
proxmox-kernel-6.5.13-6-pve-signed: 6.5.13-6
proxmox-kernel-6.5: 6.5.13-6
proxmox-kernel-6.5.13-1-pve-signed: 6.5.13-1
pve-kernel-5.15.143-1-pve: 5.15.143-1
pve-kernel-5.15.74-1-pve: 5.15.74-1
pve-kernel-5.15.30-2-pve: 5.15.30-3
ceph-fuse: 16.2.11+ds-2
corosync: 3.1.7-pve3
criu: 3.17.1-2
glusterfs-client: 10.3-5
ifupdown2: 3.2.0-1+pmx11
ksm-control-daemon: 1.5-1
libjs-extjs: 7.0.0-5
libknet1: 1.28-pve1
libproxmox-acme-perl: 1.5.1
libproxmox-backup-qemu0: 1.4.1
libproxmox-rs-perl: 0.3.4
libpve-access-control: 8.2.0
libpve-apiclient-perl: 3.3.2
libpve-cluster-api-perl: 8.0.10
libpve-cluster-perl: 8.0.10
libpve-common-perl: 8.2.9
libpve-guest-common-perl: 5.1.6
libpve-http-server-perl: 5.1.2
libpve-network-perl: 0.9.8
libpve-rs-perl: 0.8.12
libpve-storage-perl: 8.2.8
libspice-server1: 0.15.1-1
lvm2: 2.03.16-2
lxc-pve: 6.0.0-1
lxcfs: 6.0.0-pve2
novnc-pve: 1.5.0-1
proxmox-backup-client: 3.2.9-1
proxmox-backup-file-restore: 3.2.9-1
proxmox-firewall: 0.5.0
proxmox-kernel-helper: 8.1.0
proxmox-mail-forward: 0.3.1
proxmox-mini-journalreader: 1.4.0
proxmox-offline-mirror-helper: 0.6.7
proxmox-widget-toolkit: 4.3.1
pve-cluster: 8.0.10
pve-container: 5.2.2
pve-docs: 8.2.4
pve-edk2-firmware: 4.2023.08-4
pve-esxi-import-tools: 0.7.2
pve-firewall: 5.0.7
pve-firmware: 3.14-1
pve-ha-manager: 4.0.5
pve-i18n: 3.2.4
pve-qemu-kvm: 9.0.2-4
pve-xtermjs: 5.3.0-3
qemu-server: 8.2.7
smartmontools: 7.3-pve1
spiceterm: 3.3.0
swtpm: 0.8.0+pve1
vncterm: 1.8.0
zfsutils-linux: 2.2.6-pve1
 
I'm not a professinal with the Job Schedule so i aked, ChatGPT xD


The confusion lies in the syntax and logic used by the Proxmox scheduler, which is slightly different from traditional cron-style syntax. Let’s break it down step by step for clarity.


Understanding mon..fri 6..21/3:00

  1. mon..fri: Specifies that the schedule applies Monday through Friday.
  2. 6..21: This indicates the range of hours (6:00 AM to 9:00 PM).
  3. /3:00: This means the interval between runs is 3 minutes, not hours. This is where the misunderstanding arises.
The scheduler interprets /3 as a step or frequency in minutes, not hours, for the given range.


Correct Syntax for Every 3 Hours (6:00 AM to 9:00 PM)​

To achieve your goal of every three hours between 6:00 and 21:00:

  • Use mon..fri 6..21:00/3:00.
Here’s why:

  1. 6..21:00 defines the range of hours (6:00 to 21:00).
  2. /3:00 specifies the interval in hours, as the time after the colon (:00) indicates the resolution.
This ensures it runs at 06:00, 09:00, 12:00, 15:00, 18:00, and 21:00 on weekdays.


Why 12/2:5 Means "Every day starting at 12:05 until 22:05, every 2 hours"​

  1. 12: Start hour is 12:00 (noon).
  2. /2:5:
    • /2 indicates every 2 hours.
    • :5 specifies a 5-minute offset from the start hour.
Thus:

  • Starts at 12:05 (12:00 + 5 minutes).
  • Runs every 2 hours, so it hits: 12:05, 14:05, 16:05, 18:05, 20:05, 22:05.

Why It Doesn't Run Past 22:05​

By default, Proxmox considers the scheduling range to be the active day (midnight to midnight). Since no explicit ending range is defined in 12/2:5, the scheduler stops evaluating after 22:05.

If you wanted a clearer range:

  • 12..22:5/2:00 would work, but the additional range (..22) isn’t necessary since the logic implicitly handles it.

Key Takeaways​

  1. Ranges (6..21) define the active period.
  2. Steps (/3)apply differently based on whether they follow hours or minutes:
    • 6..21/3:00 → Every 3 minutes in that range.
    • 6..21:00/3:00 → Every 3 hours in that range.
  3. Offsets (:5) adjust the start time within the defined range.
By carefully combining ranges, steps, and offsets, you can achieve flexible scheduling.
 
Last edited:
If I put "mon..fri 6..21/3:00" into https://pbs.proxmox.com/docs/prune-simulator/ (presumably the prune simulator uses the same logic as the backup scheduler), I get every three minutes.

If I put "mon..fri 6..21:00/3:00" in, I get every three minutes.

If I put "mon..fri 6..21:00/3" in, I get every three minutes.

If I put "mon..fri 6..21/3" in, I get an error (invalid schedule)

If I put "mon..fri 6/3:00" I get every three hours from 0600-2100.

The last one works and does what I want, but I'm still not understanding why the others don't. I can see that the only reason it does work is because the last time in my schedule (2100) happens to be the last possible a three-hourly job could run. So what if I changed my critera - say I want the backup to run every two hours between 0600 and 2000? "mon..fri 6/2:00" would also run a job at 2200...
 
Last edited:
Hi,
the : "binds less strongly" than the / or .., i.e. you have hour matches : minute matches : second matches so for example your 6..21:00/3:00 means hour matches are 6..21, minute matches are 00/3 and second matches are 00 and the schedule will match a given time if each component of it matches.
 
Last edited:

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!