Taking advantage of the "comments" field when doing backups

tlex

Member
Mar 9, 2021
103
14
23
43
Is there a way the content of the field "comment" could follow the backups on the PBS servers ?

I used to take advantage of vzdump-rename script when I was dumping my backups locally in order to rename backups the way we like it but this is not working with pbs so I was wondering if you had any idea / suggestions of what could be done in order to populate the comment field for each backup on the pbs server ?

1647375549839.png1647375645499.png
 
Hi,
this comment is just there to describe the job. It's not added to the backups themselves.
EDIT: would fixing bug 438 also fix your use case? With this patch in place, we could finally fix that by adding the VM/CT name as a default note. Or we might think about adding a note field to backup jobs.
 
Last edited:
Hi,
this comment is just there to describe the job. It's not added to the backups themselves.
EDIT: would fixing bug 438 also fix your use case? With this patch in place, we could finally fix that by adding the VM/CT name as a default note. Or we might think about adding a note field to backup jobs.
Correct. That's why I was suggesting that if it is complicated to rename the dumpfile itself maybe it would be easier to take advantage of the "comment" field itself. That would make it easier for users to define whatever information they want next to the backup file itself if that comment would follow the backup job where ever it goes (local storage or pbs server). That "comment" field could be stored in a txt files that is created when the dump occurs (or as a setting in the vm config file) and follows it to the backup location. And you could have common variables accessible in that "comment" field that you could type in the gui such as :
$VM, $SourceServerName, $BackupSize, $Whatever.... Based on the users needs.

The backup destination would then read that file and populate the gui accordingly.

I'm not a programmer, just a dreamer :) But maybe that would be easier to implement ?
 
Correct. That's why I was suggesting that if it is complicated to rename the dumpfile itself maybe it would be easier to take advantage of the "comment" field itself.
Backups currently do have a notes property already which is what you can edit via GUI/API.

That would make it easier for users to define whatever information they want next to the backup file itself if that comment would follow the backup job where ever it goes (local storage or pbs server).
IMHO it makes sense to have the job's comment separate from a notes field to be added to backups automatically. Part of the patch series that I linked to introduces a notes parameter for vzdump and exposes it in the GUI, although only for manual backups in it's current version. But we'll likely add it for jobs too.

That "comment" field could be stored in a txt files that is created when the dump occurs (or as a setting in the vm config file) and follows it to the backup location.
That's how the current notes are already implemented on file-based storages ;)

And you could have common variables accessible in that "comment" field that you could type in the gui such as :
$VM, $SourceServerName, $BackupSize, $Whatever.... Based on the users needs.
That's essentially what a colleague of mine already suggested today, here is the brief discussion.

The backup destination would then read that file and populate the gui accordingly.

I'm not a programmer, just a dreamer :) But maybe that would be easier to implement ?
 
I use a backup-hook as script in the jobs.cfg

script /root/bin/backup-hook.sh

#!/bin/bash

# Momenti passati allo script come $1
#job-start
#backup-start
#pre-stop
#pre-restart
#post-restart
#backup-end
#log-end
#job-end
#
# aggiungerlo al vzdump come --script pathcompleto (deve essere eseguibile) in /etc/pve/vzdump.cron
# o a jobs.cfg come script /root/bin/backup-hook.sh


export PBS_PASSWORD="mypasssword"
export PBS_REPOSITORY="remote@pbs@PBSIPADDRESS:datastore"
case $1 in
backup-end)
/usr/bin/proxmox-backup-client snapshot notes update "$TARGET" $HOSTNAME
;;
log-end)
echo "############################################################"
/usr/bin/proxmox-backup-client snapshot notes show "$TARGET"
echo "############################################################"
;;
list)
echo "############################################################"
/usr/bin/proxmox-backup-client snapshot list
echo "############################################################"
;;
esac


it works
 
Hi,
this comment is just there to describe the job. It's not added to the backups themselves.
EDIT: would fixing bug 438 also fix your use case? With this patch in place, we could finally fix that by adding the VM/CT name as a default note. Or we might think about adding a note field to backup jobs.

What about to leave the user the possibility to choose if the VM/CT name is the default note?
I would definitely activate that option.
Especially with the remote sync jobs its nice to read in clear names what is that backup from.
 
What about to leave the user the possibility to choose if the VM/CT name is the default note?
You can already do that. For backup jobs by using the webUI and for manual backups by editing the vzdump.conf.
 
I am sorry, but the comment is not shown, see attachment.
When I open the specific backup (by clicking on + at for eg. vm/101), I can do see the comments but not at root level of each backup.
 

Attachments

  • Bildschirm­foto 2023-04-12 um 08.10.23.png
    Bildschirm­foto 2023-04-12 um 08.10.23.png
    30.4 KB · Views: 11
Hi,
I am sorry, but the comment is not shown, see attachment.
When I open the specific backup (by clicking on + at for eg. vm/101), I can do see the comments but not at root level of each backup.
the comment for the backup group needs to be set manually right now. But there is a feature request to show the comment of the latest backup if no explicit comment for the group is set: https://bugzilla.proxmox.com/show_bug.cgi?id=4260
 
  • Like
Reactions: fips
Any idea when this is going to be fixed? It would be really nice if the automated backups would be setting this. Current version of pbs and the server is still not doign this.
 

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!