Standalone backup agents for Linux and Unix workloads on-premises or in the public cloud
Post Reply
ThierryF
Enthusiast
Posts: 77
Liked: 18 times
Joined: Mar 31, 2018 10:20 am
Contact:

parsing veeamconfig outputs...

Post by ThierryF »

Hello Veeam team,

As grabbing info for Solaris agent from VBR using powershell is not possible [yet ?],
an easy and great enhancement for Unix minded guys would be to have field separator option
in veeamconfig to custom ouptuts (eg --SEPARATOR <PATTERN>)
It would allow easier string split and output scripting ...

Something like ..

Code: Select all

root:/opt/veeam/bin# ./veeamconfig job list
Name       ID                                      Repository
SOL-TEST1  {6bdbf114-56af-4e59-ba48-d84525cee7c3}  [srv01] Repo

root:/opt/veeam/bin# ./veeamconfig job list --separator ##
Name       ## ID                                      ## Repository
SOL-TEST1  ## {6bdbf114-56af-4e59-ba48-d84525cee7c3}  ## [srv01] Repo
Warm regards,

TH

oleg.feoktistov
Veeam Software
Posts: 664
Liked: 236 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: parsing veeamconfig outputs...

Post by oleg.feoktistov »

Hi,

Moved your topic to the relevant forum since it is rather about unix-based cli than powershell.

Thanks!

oleg.feoktistov
Veeam Software
Posts: 664
Liked: 236 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: parsing veeamconfig outputs...

Post by oleg.feoktistov »

@ThierryF

Since columns already have a space separator, have you considered using awk to parse these fields?

Examples:

Code: Select all

MacBook-Air-5:Desktop olegfeoktistov$ ./veeamconfig job list | awk '{print $2}'
ID
{6bdbf114-56af-4e59-ba48-d84525cee7c3}

MacBook-Air-5:Desktop olegfeoktistov$ ./veeamconfig job list | awk 'BEGIN {min=2;max=5} { if (NR>=min) { if (NR<=max) print $3, $4}}'
[srv01] Repo
Thanks,
Oleg

ThierryF
Enthusiast
Posts: 77
Liked: 18 times
Joined: Mar 31, 2018 10:20 am
Contact:

Re: parsing veeamconfig outputs...

Post by ThierryF »

Sure, but as space are allowed in job name, having one or more space in job name and stuff is broken :-D

Cheers

TH

oleg.feoktistov
Veeam Software
Posts: 664
Liked: 236 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: parsing veeamconfig outputs...

Post by oleg.feoktistov »

Makes sense to me. Though, my first concern here would be that awk might be treating both ## and spaces as separators leading to more confusion. @PTide, what do you think?

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest