Different prefilebackup scripts for virtual sub clients


#1

Can anyone tell if it is possible to run different scripts for each virtual sub client? The documentation is not clear about this feature and only mentions some parameters that can be used, however, does not explain how they should be used. I believe I should use parameter 3 - File backup group - but the documentation also does not mention this term at any other time.

I really need some help to make this work, but I’m totally lost as to the operation of these parameters, could someone explain me better, please?

  1. What would it be “File backup group” and how do I define them?
  2. How to use this parameter to run specific scripts for each virtual sub client?

UrBackup is an excellent tool and fulfills almost every need, and I take the opportunity to thank the developers and the community for this, but without the possibility to configure different prefilebackup scripts for each virtual client, it will probably become impractical for my needs.

I hope it’s possible and someone can show me the way.
Thanks.


#2

I admit it’s not really nice. You are the first one I have heard about who wants to use different scripts for different virtual clients (I use it myself though).

File backup group is the number (group offset) you get via:

echo "SELECT virtual_client, group_offset FROM virtual_client_group_offsets;" | sqlite3 /usr/local/var/urbackup/backup_client.db

Zero for the non-virtual client.


#3

Hi Uroni, thank you very much for the fast reply.

My clients are Windows and I was able to adapt your suggestion to it. Received as return “Name of the virtual sub client | 100”. I’m feeling happy with this first step, but I still have no idea how to configure this in UrBackup.

Thanks!


#4

Just to be clear, I was able to print the file backup group with the adapted command for Windows client:

echo SELECT virtual_client, group_offset FROM virtual_client_group_offsets; | sqlite3 “C:\Program Files\UrBackup\urbackup\backup_client.db”

Result:

VirtualClient1Name|100
VirtualClient2Name|200

The point is that I did not understand how I should use the 3 available parameters (1: “0” for full backup “1” for incremental file backup 2: Server token 3: File backup group). Where and how should I enter parameters? How I am going to run different scripts for virtual sub clients if UrBackup works with only one prefilebackup batch file?

“echo $1”, “echo %1” or “echo %%1” doest not bring any result, both on Windows and Linux clients.

I’m so confused about it, could you please give us an example of this configuration? The example in PostgreSQL documentation did not help much.

Thank you.


#5

Got it!! Parameters only work when backup job is running, that’s why echo tests at CMD did not give any results. Just added the line below at the start of the script and now it runs only on the defined group:

if %3 NEQ 200 GOTO:EOF

Using IF and ELSE conditions makes possible to run different commands on different virtual sub clients, but always inside the same prefilebackup.bat file, did I get it right?

Thank you so much for this awsome backup tool.