NBU bpstart用法/网络映射问题

发布于 2022-08-02 07:36:02 字数 643 浏览 10 评论 3

最近在给客户做NBU6.5文件备份的一个测试。
客户要求运行备份策略前,先调用一个bat脚本,该脚本的作用是映射网络驱动器至本地,例如映射成Z盘,然后再通过NBU策略备份该盘里的文件。

我的测试步骤如下:
    1.复制该脚本(脚本里是net use命令)至install_pathNetbackupbin目录下
    2.先测试该脚本,直接运行binbpstart_notify.policyname.bat脚本可以成功映射网络驱动。
    3.命令行下用net use z: /del删除该映射,NBU上建立该policy,backup selection手动添加Z:
      4.运行policy后,报71号错,打开“我的电脑”显示该网络映射有问题,有一个红色的小XX,但是双机该盘符(Z)可以进入该盘
    5.用net use z: /del无法删除该映射。
因此,我发现主要的问题是把这个脚本放至bin目录下后,通过建立的policy运行脚本后,没有成功的映射网络驱动器(但是直接运行可以)。

对NBU备份和网络映射都不是太熟,请问各位兄弟,问题出在哪?要做到客户的要求,我的测试应该怎么做?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

万人眼中万个我 2022-08-06 08:12:33

另外,你可以在脚本里临时放一个可以debug的语句,比如
del c:tempabc.log
echo "script run" > c:tempabc.log

运行policy后查一下abc.log是否生成了。如果没生成,说明你的脚本根本没被nbu调用;如果生成了,可能就是net use的权限问题了。

宛菡 2022-08-06 03:20:00

试一下把NetBackup Client Service的LogOnAs改为Administrator,因为NetBackup缺省是用LocalSystem干活的,可能没有net use的权限

物价感观 2022-08-03 04:42:15

Scripts must be located in netbackupbin and have the naming convention:
bpstart_notify.your_policy_name.specific_schedule_name.bat
bpend_notify.your_policy_name.specific_schedule_name.bat

The specific_schedule_name does not need to be there.

For example:  
bpstart_notify.loc1_server1_nt.bat
@REM this script is called by NetBackup when a backup is initiated
@REM this script:
@REM    receives 4 parameters, clientname, classname, schedname and schedtype
@REM    must be executable by a user with Administrator rights
@REM    should exit with 0 upon successful completion
@REM
@REM If this script will not complete within a few seconds, you should set
@REM the BPSTART_TIMEOUT in the NetBackup configuration gui on the server.
@REM You should also be aware that the time taken by this script will delay
@REM the initiation of other client's backups.
@REM
@REM - This script only runs on NT 4.0 and succeeding versions of NT.  You must
@REM - have command extensions enabled.  Check the following registry entry:
@REM - HKEY_CURRENT_USERSoftwareMicrosoftCommand ProcessorEnableExtensions
@REM -
@REM - It should be set to 0x1 or you may have problems running this script.
@setlocal ENABLEEXTENSIONS
@set LISTPATHS="%~dp0goodieslistpaths"
@for /F "delims=|" %%p in ('%LISTPATHS% /s NB_MAIL_SCRIPT') do @set NB_MAIL_SCRIPT="%%p"
@set OUTF="d:srvappsveritasbackupresultsbpstart_notify.loc1_server1_nt.txt"
@REM - Get date and time.
@REM
@for /F "tokens=1*" %%p in ('date /T') do @set DATE=%%p %%q
@for /F %%p in ('time /T') do @set DATE=%DATE% %%p
@REM
@echo "This is a start_notify script" > %OUTF%
@REM
@REM  Unremark the following line and add you batch file, command file etc.
net stop "nai epolicy orchestrator agent" >> %OUTF%
net stop "network associates mcshield" >> %OUTF%
net stop "network associates alert manager" >> %OUTF%

And...
bpend_notify.loc1_server1_nt.bat
@@REM this script is called by NetBackup when a backup has completed
@REM
@REM this script:
@REM    receives 5 parameters,
@REM        CLIENTNAME, CLASSNAME, SCHEDNAME, SCHEDTYPE and STATUS
@REM    must be executable by a user with Administrator rights
@REM    should exit with 0 upon successful completion
@REM
@REM If this script will not complete within a few seconds, you should set
@REM the BPSTART_TIMEOUT in the NetBackup configuration gui on the server.
@REM You should also be aware that the time taken by this script will delay
@REM the initiation of other client's backups.
@REM - Main program
@REM -
@REM - This script only runs on NT 4.0 and succeeding versions of NT.  You must
@REM - have command extensions enabled.  Check the following registry entry:
@REM - HKEY_CURRENT_USERSoftwareMicrosoftCommandProcessorEnableExtensions
@REM - It should be set to 0x1 or you may have problems running this script.
@REM
@setlocal ENABLEEXTENSIONS
@set LISTPATHS="%~dp0goodieslistpaths"
@for /F "delims=|" %%p in ('%LISTPATHS% /s NB_MAIL_SCRIPT') do @set NB_MAIL_SCRIPT="%%p"
@set OUTF="d:srvappsveritasbackupresultsbpend_notify.loc1_server1_nt.txt"
@REM
@REM - Get date and time.
@for /F "tokens=1*" %%p in ('date /T') do @set DATE=%%p %%q
@for /F %%p in ('time /T') do @set DATE=%DATE% %%p
@ECHO "This is an end notify script" > %OUTF%
@REM unremark the following line and call your command file, batch file etc...
net start "network associates mcshield" >> %OUTF%
net start "nai epolicy orchestrator agent" >> %OUTF%
net start "network associates alert manager" >> %OUTF%

If you found this useful, please mark it as such so that others can benefit.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文