Primary Storage

  • 1.  The process cannot access the file because it is being used by another process.

    Posted Wed February 07, 2018 09:20 PM

    Hello Guys,

    I am facing a issue in TSM i have prepare few batch file and extension is .cmd that means it will call cmd to execute the file, now when one backup run another got fail then i notice when first cmd run lets say for taking a backup of drive and another has to backup of system state or SQL DB it doesn't run that why getting error 1 on tsm when i checked on log then found that .cmd itself has not executed, that is the cause of failure then I thought let's run on foreground and check then I am getting below error.

    Error -The process cannot access the file because it is being used by another process.

    Same error is coming when I am invoking that manually from command prompt so my calculation says the previous cmd has not stopped that is why it is not allowing to run another, i started searching dsmc on services and .cmd process I killed all of them but no luck. at the same when I restart the client machine and attempt to run that works smoothly so i am just wondering if anyone can advise what can be done. here is the details inside the .cmd.

    .CMD details which will invoke at the time of schedule.

    @ECHO OFF
    rem  ==================================================================
    rem  ==================================================================

    set backup_dir="C:\Program Files\Tivoli\TSM\baclient"

    cd /d %backup_dir%

    rem  ==================================================================
    rem   The 2 lines below put a date and time stamp in a log file for
    rem   you.
    rem
    rem   Note: You can change "backup.log" to whatever you prefer.
    rem  ==================================================================
    echo Current date is: >> Daily_incr.log
    date /t < NUL >> Daily_incr.log
    echo Current time is: >> Daily_incr.log
    time /t < NUL >> Daily_incr.log

    rem  ==================================================================
    rem   Now call the command line to do the full backup:
    rem
    rem   Note: You can change "backup.log" to whatever you prefer.
    rem  ==================================================================
    dsmc backup systemstate >> Daily_incr.log
    dsmc incr c:\* -su=yes >> Daily_incr.log

     

    I am guessing I have to put the pipe to close it once it execute that could be the case but not sure that is correct thinking if yes where to put and what to put.

     

    Thanks

    Prem

     


    #PrimaryStorage
    #StorageManagementandReporting
    #Storage


  • 2.  RE: The process cannot access the file because it is being used by another process.

    Posted Thu February 08, 2018 12:17 AM

    Hi,

    You may have a filename in dsm.opt that is used too.

    Do a trace and see what files it complaints about.

     

    dsmc incr c:\ -traceflag=service -tracefile=c:\temp\trace.out

    Look for filenames in trace.out, and see if you can get a clue about which file is being held opened.

     

    Håkon Ph. Tønder-Keul

    TSM Manager @ Basefarm


    #PrimaryStorage
    #Storage
    #StorageManagementandReporting


  • 3.  RE: The process cannot access the file because it is being used by another process.

    Posted Thu February 08, 2018 03:35 AM

    Hello,

    I tried checking but unable to find any file which is being held open can you please check once.

     

    Thanks

    Prem


    #PrimaryStorage
    #StorageManagementandReporting
    #Storage


  • 4.  RE: The process cannot access the file because it is being used by another process.

    Posted Thu February 08, 2018 04:00 AM

    Hi,

    The error you get is a windows error.  Try piping the logs to a different directory, like c:\temp

    Håkon Ph. Tønder-Keul

    TSM Manager @ Basefarm


    #PrimaryStorage
    #Storage
    #StorageManagementandReporting


  • 5.  RE: The process cannot access the file because it is being used by another process.

    Posted Thu February 08, 2018 07:34 AM

    If the issue is that the first dsmc command needs to complete before running the second, you could try using "start /wait" inside your .cmd file.  I use this in a .cmd that does multiple Exchange database backups, one at a time.  You would revise those two lines of the script like this:

    start /wait dsmc backup systemstate >> Daily_incr.log
    start /wait dsmc incr c:\* -su=yes >> Daily_incr.log


    #Storage
    #StorageManagementandReporting
    #PrimaryStorage


  • 6.  RE: The process cannot access the file because it is being used by another process.

    Posted Thu February 08, 2018 09:27 AM

    Thanks Maria, for your response I have change as below and monitoring this as of now. because what i was observing is one command works fine since no switch was mention to exit after the command completes that could be the cause .cmd held open in the background, what is your take pls feel free to advise.

    dsmc backup systemstate >> backupfull.log
    dsmc incr C:\* -su=yes >> backupfull.log
    exit %RC%

    Thanks

    Prem


    #Storage
    #PrimaryStorage
    #StorageManagementandReporting