How to create 2nd GarbageCollection job (or run GC-job twice from a single schedule)?

pmra

New Member
Dec 10, 2023
3
0
1
Hi,
apparently a GC job, whilst running, only marks blocks as "to be deleted" but doesn't do so. Only the next run actually deletes these marked data.
For that reason I'd like to run the GC job once a day (after backups and pruning) but twice immediately after another.
Unfortunately a schedule like 2:55,3:00 is misinterpreted as 2:03, also apparently I cannot just create a 2nd job running a few minutes later.

So how can I create said 2nd job or how can I run a GC job twice within minutes (w/o scheduling sth like "each 5 minutes for 24/7")?

Thank you!1.jpg
 
Hi,
creating a second garbage collection job is not possible and will not help you. The garbage collection logic only allows to remove chunks which have not been touched within a day, see https://pbs.proxmox.com/docs/backup-client.html#client-garbage-collection.
If you want to frequently clean up unused chunks, run the garbage collection daily.

Edit: In your example, the manual garbage collection probably removed chunks which have not been referenced by any snapshot index files for more than 24h since one of the previous garbage collection runs.
 
Last edited:
  • Like
Reactions: news
Hi,
and thank you for your answer!

Interestingly using trial-and-error I found a way to schedule 2 (and only 2) jobs: 22:51/5 (better: 22:51,55) starts GC at 22:51 and 22:56.

I also found the older GC log files and e.g. these two sequent logs (only 12h apart) are where I got my idea from.
scheduled run:
2024-07-27T22:55:28+02:00: Removed garbage: 2.518 GiB
2024-07-27T22:55:28+02:00: Removed chunks: 2562
2024-07-27T22:55:28+02:00: Pending removals: 2.811 GiB (in 2687 chunks)
manual run the next morning:
2024-07-28T09:57:32+02:00: processed 99% (29886 chunks)
2024-07-28T09:57:32+02:00: Removed garbage: 2.811 GiB
2024-07-28T09:57:32+02:00: Removed chunks: 2687

I'll watch it the next days¹ and report back.



¹ I recreated the store yesterday bc it grew too big for my use, only have 2 days retention so 1st results are to be expected the day after tomorrow
 
Last edited:
Hi,
and thank you for your answer!

Interestingly using trial-and-error I found a way to schedule 2 (and only 2) jobs: 22:51/5 starts GC at 22:51 and 22:56.

I also found the older GC log files and e.g. these two sequent logs (only 12h apart) are where I got my idea from.
scheduled run:
2024-07-27T22:55:28+02:00: Removed garbage: 2.518 GiB
2024-07-27T22:55:28+02:00: Removed chunks: 2562
2024-07-27T22:55:28+02:00: Pending removals: 2.811 GiB (in 2687 chunks)
manual run the next morning:
2024-07-28T09:57:32+02:00: processed 99% (29886 chunks)
2024-07-28T09:57:32+02:00: Removed garbage: 2.811 GiB
2024-07-28T09:57:32+02:00: Removed chunks: 2687

I'll watch it the next days¹ and report back.



¹ I recreated the store yesterday bc it grew too big for my use, only have 2 days retention so 1st results are to be expected the day after tomorrow
Well, nevertheless the logic based on the atime of the chunks as described in the documentation applies ;)
 
So apparently removing a chunk is not counted as access. That'd be great, then it would work as I hoped.
 

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!