The support forum

Jobs status monitoring

lubo278 :

Oct 19, 2018



[ In continuation of https://bvckup2.com/support/forum/topic/436/6200 ]

@Alex: thank you for your reply
My situation is that I have many servers, each with about 30-50 sync jobs. I would like to list these jobs (Source -> Target, Status: change/no change/syncrhonizing/failed).

Commandline - I can get status of jobs, but I don't get "source", "target" information.

Env. vars - I would have to set pre and post-backup scripts for each job + when adding new job remember to add this script.

What I was suggesting is I can set post-backup e.g. test.exe and check what test.exe env. vars are. If this would be set also to bvckup2.exe, I would have no need to set post-backup script, just check bvckup2.exe periodically.

Other posibility for me would be to have global pre and post-backup scripts. It would be probably more consistent with original idea of "scripts".

Alex Pankratov :

Oct 19, 2018

What I was suggesting is I can set post-backup e.g. test.exe and check what test.exe env. vars are. If this would be set also to bvckup2.exe, I would have no need to set post-backup script, just check bvckup2.exe periodically.


Sorry, I still don't understand what you mean. Environment vars are the property of a running process, not of an exe.

In terms of mass-deploying a post-backup script, this is easy to do with an engine-level override, which is applied to all backup jobs when they are loaded at launch. See 2nd section here -  https://bvckup2.com/support/forum/topic/480/5850

PS. That said, I think something like a JSON API wouldn't be a bad thing to have.

lubo278 :

Oct 22, 2018

Sorry, Maybe I miss something.
I know that env. variables are "attached" to instance of a running process. The problem or question is which process. It is process of the "script" (post- or pre-backup). So whenever the synchronization process starts I can get the variables if I set the post-script for each synch job I have. If I miss this or do not setup scripts correctly, the information is lost.

I would like to get this information anytime and preferably without setting anything in UI (even without running post-backup scripts). So my guess was to check the env. variables of bvckup2.exe process/service and I can not find any additional values (other than system).
I presume you set env. variables of the script you are starting. If you could just set also variables of your current process (bckup2.exe) it would do the job for me.
e.g. call this System.Environment.SetEnvironmentVariable
I would just parse all keys of bvckup2.exe anytime and I can see which jobs are running, failed, etc.

thank you again for your time

Alex Pankratov :

Oct 22, 2018

If I miss this or do not setup scripts correctly, the information is lost.


That's a rather artificial argument against using pre/post-scripts. It's really quite trivial to set scripts up correctly, verify they are working and then never need to look at them again.

If you could just set also variables of your current process (bckup2.exe) it would do the job for me.


We won't do this, sorry.

Environment variables are meant for communicating values from a parent to child process or from a system to a process. They aren't meant for to be used for exporting process' variables to everyone on the system.

Secondly, there's no clean way to read env variables of a process anyway, not on Windows. If you were planning to use GetEnvironmentVariable or similar, you may want to double check how it works - it will get you env vars of _your own_ process.

That said, there should be a way to query more detailed status from a running Bvckup 2, and I made a note to have this implemented.

lubo278 :

Oct 24, 2018

Ok, thanks even for (far) future promise :)

@GetEnvironmentVariable:
yes, I know, but there are ways to read other process env. vars.

I use something similar to this (this is not my code, but it looks everybody shares this snippet)

https://github.com/shadowsocks/shadowsocks-windows/blob/master/test/ProcessEnvironment.cs

Thanks again, good luck, it is great software!

Alex Pankratov :

Oct 24, 2018

ProcessEnvironment.cs


Yeah, that's exactly what I meant by "no clean way to read env vars" :-)

It uses parts of PEB and RTL_USER_PROCESS_PARAMETERS that are undocumented. In practical terms this works, of course, but it also hints that reading other process environment is not something meant for the mainstream use.

New topic

Create
Made by Pipemetrics in Switzerland
Support

Follow
Blog / RSS
Social Twitter
Reddit
Miscellanea Press resources
Testimonials
Company
Imprint
Legal Terms
Privacy