我已经编写了PostgreSQL备份脚本,将所有数据库备份到文件中。 pgAgent.exe (一个调度守护进程)在本地postgres用户下启动BAT脚本。
正常的设置是备份到本地驱动器,并获得备份程序来拿起文件,但我们有一个客户端,要备份到networking驱动器。
我尝试运行pgAgent,并通过扩展pipe理用户下的脚本,仍然没有任何运气。 (具有驱动器映射的相同用户)
当我通过运行runas.exe /user:postgres cmd.exelogin到postgres用户runas.exe /user:postgres cmd.exe并键入cd /DZ:我得到错误The system cannot find the drive specified.
现在,据我所知,networking驱动器映射在每个用户会话的基础上。 有一个特殊的技巧,从命令提示符访问networking驱动器?
REM Mount Z:\ as the user with permissions; you may need to add the password net use z: \\server\share /user:domain\user REM copy things here REM ... REM unmount the drive letter net use z: /d
如果networking共享共享给“所有人”,则可以使用net use Z: \\SERVERNAME\SHARE