I assume that when you run the script manually, you are logged on as user Administrator. Bacula-fd probably runs the script as user bacula, or some other user.
There are several things that could go wrong here. I don't remember off the top of my head what error 59 is, but I believe it is related to some kind of logon failure. First, you may be using the wrong administrator account. You don't specify the realm of Administrator, so Windows may be using the local administrator account or the domain administrator account when you really may have meant to use the NAS Administrator account, or vice versa. In particular watch out for that if the service account you are using is a local account but the account you are using for testing is a domain account, or vice versa. Second, Windows has a limitation: you can only be logged onto each server as one user at a time. This logon information actually stays around even after you disconnect all drives, printers etc. from that server - basically, the only way to get rid of it is to log out of your local session. This is actually a limitation of the client implementation, so it doesn't matter if there is a NAS or some other device on the server end. So if, during your manual testing, you already connected to the NAS at some point, Windows will actually ignore the /user:Administrator option, and reuse whatever user you have been logged on as before. The bacula service won't have access to such a preexisting connection. Finally, here is a tip for testing things in a service account that doesn't allow regular logins, at least in Windows 2003 (I haven't needed it in 2008 yet). I sometimes use this trick with the Local System account. It's actually technically a security flaw as it lets you as administrator get even into directories that you don't have permission to - like roaming profile directories, for instance -, but when debugging scripts for services, at times it comes in as a godsend. In Control Panel, find "Scheduled Tasks". Create a new scheduled task that simply launches C:\Windows\System32\cmd.exe. Specify your bacula user and password. Pick a time about two minutes in the future. Then you wait. At the appointed time, a command window will pop up, logged on as the correct service account. Test to your heart's content, run the net user command as the actual user, and see what happens. Gabriele Bulfon wrote: > Hello, > a customer bought a NAS device, that doesn't offer NFS, so I can mount > partitions only via smb. > The solaris bacula server can't mount those partitions, so I have to > run a ClientRunBeforeJob > on the Windows bacula-fd, to let it unmount/mount the NAS partition to > be able to back it up. > The batch file runs: > > net use T: /user:Administrator \\netdisk1\share password > > to mount it, but I always receive a System Error 59, stopping all that > windows job. > > If I run the batch file manually, everything works perfect. > Why it doesn't work when bacula-fd do it? > Should I change some service property? > > Thanx > Gabriele. > > <http://www.sonicle.com> > Gabriele Bulfon - Sonicle S.r.l. > Tel +39 028246016 Int. 30 - Fax +39 028243880 > Via Felice Cavallotti 16 - 20089, Rozzano - Milano - ITALY > http://www.sonicle.com > -- Kevin Keane Owner The NetTech Find the Uncommon: Expert Solutions for a Network You Never Have to Think About Office: 866-642-7116 http://www.4nettech.com This e-mail and attachments, if any, may contain confidential and/or proprietary information. Please be advised that the unauthorized use or disclosure of the information is strictly prohibited. The information herein is intended only for use by the intended recipient(s) named above. If you have received this transmission in error, please notify the sender immediately and permanently delete the e-mail and any copies, printouts or attachments thereof. ------------------------------------------------------------------------------ Crystal Reports - New Free Runtime and 30 Day Trial Check out the new simplified licensing option that enables unlimited royalty-free distribution of the report engine for externally facing server and web deployment. http://p.sf.net/sfu/businessobjects _______________________________________________ Bacula-users mailing list Bacula-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bacula-users