Unsolved
14 Posts
0
5421
List all active restore sessions/jobs from the CLI
Hi all,
Is there a way to list all restore jobs/sessions from CMD with a single line? (We have NetWorker 9.1 on Windows Server 2012)
It would be really nice if I could also see for how long it's been running, but not mandatory.
Many thanks
Victor
bingo.1
2.4K Posts
0
July 9th, 2019 08:00
You could use nsrwatch - it provides a similar interface like the Monitoring GUI.
Type 'H' to get to the online help.
bingo.1
2.4K Posts
0
July 9th, 2019 10:00
Such is not possible (something like 'jobinfo' similar to 'mminfo') does not exist.
You can use jobquery but the handling and output are in the same way as NW's 'nsradmin'.
VictorG
14 Posts
0
July 9th, 2019 10:00
VictorG
14 Posts
0
July 9th, 2019 10:00
My question is whether I can list all restore jobs from a single line in CMD.
VictorG
14 Posts
0
July 9th, 2019 10:00
I can list sessions by typing this in order:
nsradmin
show session
print type: nsr
However I don't know how to combine it into a single line.
VictorG
14 Posts
0
July 9th, 2019 10:00
I added this to file.txt:
show session
print type: nsr
I then ran: nsradmin -i file.txt
It doesn't work, what am I doing wrong
VictorG
14 Posts
0
July 9th, 2019 10:00
This almost works but gives me the wrong info:
how do I insert "show session" in there?
Ps. I can't type the command in the post, the website is bugged.
bingo.1
2.4K Posts
0
July 9th, 2019 10:00
bingo.1
2.4K Posts
0
July 9th, 2019 11:00
Just assign the command line to a variable, for example '$command'.
Then execute 'invoke-expression $command'.
bingo.1
2.4K Posts
0
July 9th, 2019 11:00
Sure it's not the info you wanted. But you used 'nsradmin' instead of 'jobquery' yourself. Of course you must use the appropriate commands.
The command line reference is very small. May I suggest that you run the following commands with "jobquery":
. type: recover job; job state: ACTIVE
show all
p
q
You will get all the attributes/parameters. Next select the ones you need and apply them to the 'show' command. If you need online help, just use 'h' within the 'shell'.
VictorG
14 Posts
0
July 9th, 2019 11:00
Do you know how to get this information in powershell ?
I need this process automated.
VictorG
14 Posts
0
July 9th, 2019 11:00
But you'd need a one-liner.. How do you do it?
In your own example. What's inside $command ?
bingo.1
2.4K Posts
0
July 9th, 2019 12:00
This will do the job:
invoke-expression "jobquery -i input_file"
It is beneficial to familarize with PowerShell. BTW - the internet is full of examples ...
crazyrov
4 Operator
4 Operator
•
1.3K Posts
0
July 10th, 2019 21:00
Try this for showing sessions using nsradmin
(echo . type: nsr & echo show session & echo print ) | nsradmin -i-
As as @bingo.1 mentioned it can be done using jobquery as well
(echo . type: recover job; job state: ACTIVE & echo print) | nsradmin -i-