cancel
Showing results for 
Search instead for 
Did you mean: 

Job failing due to pre command

Daniel_Hazel
Level 3
I am trying to run a batch file in my pre command. The job fails with the following error: "An invalid command was sent to the storage device." I can run the batch file successfully from a command prompt, but the BE job fails when I try to run it as a pre command. Any ideas?
Here is the batch file (server names and IP addresses changed for security):

c:
cd\
net use q: /delete /y
net use q: \\192.168.1.5\Server1
del q:\W2_Full\*.bkf
2 REPLIES 2

Ken_Putnam
Level 6
If you are trying to delete the last instance of the BKF file that this job is targeted at, I think the problem is that the file is "opened" as soon as the job starts, not when it actually starts writing to tape, so you are basically trying to delete a file that is in use


Try using a Scheduled Task through the OS set to run 5 minutes before the backup job starts

Daniel_Hazel
Level 3
Thanks for the reply. I did some experimenting after my post and discovered that to be the case exactly. In the pre batch file, I was trying to delete the existing bkf files from the B2Disk folder that the current job was going to write to. I was hoping that the pre command would initialize before the backup job "grabbed" the target media (in this case the B2Disk folder), but apparently that is not the case. So I've changed my strategy on how I'm going to delete existing bkf files before the job starts.

Thanks again for your reply.