Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Scripts on Unix Networker Client

Status
Not open for further replies.

speculos

Technical User
Joined
Oct 19, 2001
Messages
213
Location
FR
I have 2 problems using scripts on Unix client side to backup savesets:

1)I want to keep the reports (normal and errors),
but it seems that the save and savefs commands don't use stdout nor stderr :

savefs -s myserver -c client1 /home >sav.log 2> saverr.log

the .log files are empty...
How can I keep this usefull informations?

2)I want to use the Errorlevel, but it is always "0" even if an error occurs:

savefs -s myserver -c client1 /home
if [ "$!" = 0 ] etc...

Any Ideas or suggestions?
 
I already used the errorlevel and it works fine (but I've done it only with the save command).

I would highly recommand to launch your client side backups with the "save" command.

Regarding to the log redirection problem, I've met the same problem. I dont't remember exactly but to make it works fine you must exactly specify what you want to redirect (the basic > doesn't work).

It is something like :

save -s ... -c .... 1>&2 output.log

where 1 and 2 are source and destination (stdin / stdout) such as in most UNIX script.
 
try "save ... 1> output.log".

Hope this helps.
 
Sorry, it doesn't work for me...
I tried with Netowker 6.1.1 on AIX, on HP-UX and Windows
the messages goes directly to the terminal, never on the output.log

It is surprising, because with other commands (like mminfo or nsrjb), the output goes to the file.

Can you make the test, and tell me the result?
$ save -s server -c client1 1> save.log
 
From the "NetWorker 7 Administrator's Guide"

save “$@” > /tmp/saveout$$ 2>&1

The end of this line is important - I 'grepped' the command
itself from the context of a complete backup command script.
For the complete script, please have a look at the manual.

BTW - savefs is not supposed to be run manually initiated.
 

I understand now that all the output of the save command
(in Networker 6) goes only to stderr (even if the command is successfull)

$save -s server ... 2>save.log
is OK.

Thank you for your help
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top