tizbac / proxmoxbackupclient_go

In development proxmox backup client written in golang, aimed at windows compatibility
GNU General Public License v3.0
171 stars 12 forks source link

Issues and requests #22

Open creanet-64 opened 5 months ago

creanet-64 commented 5 months ago

Hello,

Thank you for this superb initiative which fills a serious gap when you want to harmonise the backups of windows servers with those of vms.

I want to back up two directories on a Windows server, so I've created a batch file with two identical lines except for the backupdir.

My problem is that the name of the pxar is identical between the two jobs:

When the prune job runs on the PBS server, it systematically deletes one of the two entries, almost certainly thinking that they are the same as they are launched on the same day (it actually does what I told him as I only want to keep one daily).

Would it be possible to define the name of the pxar during the job? Is it possible to specify several directories for the "backupdir" argument?

Thanks again for any help you can provide.

nbahbnco commented 5 months ago

It seems that the PXAR name is hardcoded here,in main.go :

archive := &PXARArchive{}
archive.archivename = "backup.pxar.didx"

previousDidx := client.DownloadPreviousToBytes(archive.archivename)

Would patches to specify the pxar name through argument or environment be welcomed?

In the meanwhile, I would advise you use different namespaces per computer.

creanet-64 commented 5 months ago

Hi, thanks for your rapid answer.

The problem is that there are two different directories to be backed up on the same single machine. I can certainly create a namespace for each directory, but the ideal would be to have a syntax similar to that of the official Linux client, allowing the name of the pxar file to be positioned directly in the backupdir syntax:

-backupdir rep1.pxar: "c:\rep1"

So, launching twice the backup script on two different pxar/directories should be ok and the prune job won't delete one of them randomly.

nbahbnco commented 5 months ago

Just to be clear, I am not a developer of this project, just someone tracking this out of interest. I think this change should be easy to implement.