免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 3766 | 回复: 3
打印 上一主题 下一主题

[Veritas NBU] NBU bpstart用法/网络映射问题 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-02-19 13:15 |只看该作者 |倒序浏览
最近在给客户做NBU6.5文件备份的一个测试。
客户要求运行备份策略前,先调用一个bat脚本,该脚本的作用是映射网络驱动器至本地,例如映射成Z盘,然后再通过NBU策略备份该盘里的文件。

我的测试步骤如下:
    1.复制该脚本(脚本里是net use命令)至install_path\Netbackup\bin目录下
    2.先测试该脚本,直接运行bin\bpstart_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备份和网络映射都不是太熟,请问各位兄弟,问题出在哪?要做到客户的要求,我的测试应该怎么做?

论坛徽章:
0
2 [报告]
发表于 2008-02-19 16:10 |只看该作者
Scripts must be located in netbackup\bin 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_USER\Software\Microsoft\Command Processor\EnableExtensions
@REM -
@REM - It should be set to 0x1 or you may have problems running this script.
@setlocal ENABLEEXTENSIONS
@set LISTPATHS="%~dp0\goodies\listpaths"
@for /F "delims=|" %%p in ('%LISTPATHS% /s NB_MAIL_SCRIPT') do @set NB_MAIL_SCRIPT="%%p"
@set OUTF="d:\srvapps\veritas\backupresults\bpstart_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_USER\Software\Microsoft\CommandProcessor\EnableExtensions
@REM - It should be set to 0x1 or you may have problems running this script.
@REM
@setlocal ENABLEEXTENSIONS
@set LISTPATHS="%~dp0\goodies\listpaths"
@for /F "delims=|" %%p in ('%LISTPATHS% /s NB_MAIL_SCRIPT') do @set NB_MAIL_SCRIPT="%%p"
@set OUTF="d:\srvapps\veritas\backupresults\bpend_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.

论坛徽章:
0
3 [报告]
发表于 2008-02-19 20:17 |只看该作者
试一下把NetBackup Client Service的LogOnAs改为Administrator,因为NetBackup缺省是用LocalSystem干活的,可能没有net use的权限

论坛徽章:
0
4 [报告]
发表于 2008-02-19 20:21 |只看该作者
另外,你可以在脚本里临时放一个可以debug的语句,比如
del c:\temp\abc.log
echo "script run" > c:\temp\abc.log

运行policy后查一下abc.log是否生成了。如果没生成,说明你的脚本根本没被nbu调用;如果生成了,可能就是net use的权限问题了。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP