1. You are viewing our forum as a guest. For full access please Register. WindowsBBS.com is completely free, paid for by advertisers and donations.

Print Server backups

Discussion in 'Windows Server System' started by aschwartz, 2007/07/12.

  1. 2007/07/12
    aschwartz

    aschwartz Inactive Thread Starter

    Joined:
    2002/09/26
    Messages:
    23
    Likes Received:
    0
    Hi all. Its been a while since I was around.

    I have a new question, I have 2 print servers that I am trying to backup using a scheduled task. It works when I do it manually, but as a task it fails.

    Heres what I am doing, and if theres an easier way, please let me know.

    We have 2 print servers, and are using printmig from microsoft to back them up. It creates a .cab file that we have used to restore in the past. It works when run normally, and it works when I run it via cmd line as per the instructions, but when I automate it via a .bat file, it doesnt work. Heres what I do. I first run a bat file from the scheduled task:

    cd\
    cd pstools
    psexec \\par-nrt-print c:\printmig\printbkp.bat -u nrthome\(username) -p (password)

    dir /s *.jpg
    REM - the above line is for a delay to allow the previous to finish
    copy \\par-nrt-print\c$\printmig\*.cab \\par-real-fp1\sysops$\prtbackups\nrthome\

    Here is a copy of the printbkp.bat file:

    set mmyydd=%date:~4,2%%date:~7,2%%date:~12,2%

    c:
    cd\
    cd printmig
    printmig.exe -b c:\printmig\nrt_%mmyydd%.cab -i

    This file does the backup and names the file with the date, ie. 070707.

    It doesnt work automated. Am I doing something wrong, or is there a better way to do this?
     
  2. 2007/07/16
    ReggieB

    ReggieB Inactive Alumni

    Joined:
    2004/05/12
    Messages:
    2,786
    Likes Received:
    2
    I'd check the rights of the user account running the scheduled task. Does that account have rights to access the backup location? Is it the same account you are using to run the manual backups?

    If you are only backing up a print server, why do you need a scheduled backup? Most print services rarely change, and therefore only need a new backup image when a change is made.
     

  3. to hide this advert.

  4. 2007/07/20
    aschwartz

    aschwartz Inactive Thread Starter

    Joined:
    2002/09/26
    Messages:
    23
    Likes Received:
    0
    I agree. The only reason I had a scheduled backup running was that my manager asked if I could. I had just recently set up scheduled tasks to take a csv dump of our AD, from 5 different domains each week, so that we have a valid backup just in case aside from the hard backups. I figured it wouldnt be difficult, and gave it a shot.

    The accounts in question are both domain admins, and have full rights to both the print servers, as well as the tools server that is running the task, and the file share where they are located. Its puzzling.
     
  5. 2007/07/22
    ReggieB

    ReggieB Inactive Alumni

    Joined:
    2004/05/12
    Messages:
    2,786
    Likes Received:
    2
    This is a possible problem line. In my experience, XCOPY works more reliably via a bat file than copy. One key problem can be the handling of copy conformation. With XCOPY you can use the /Y switch to suppress the copy conformation.

    Also it might be worth checking your use of named variables. I think you sometimes have to double up percentage signs. Sometime %variable% won't work, but %%variable%% will.

    I think I would remove the complicated folder movements here:
    Code:
    c:
    cd\
    cd printmig
    printmig.exe -b c:\printmig\nrt_%mmyydd%.cab -i
    I think you can achieve the same result if you give a full path to the application. So:
    Code:
    c:\printmig\printmig.exe -b c:\printmig\nrt_%mmyydd%.cab -i
    will do the same thing without having to more location.

    Similarly:
    Code:
    c:\pstools\psexec \\par-nrt-print c:\printmig\printbkp.bat -u nrthome\(username) -p (password)
    would be simpler than your psexec sequence

    The other option, which does require more work, is to see if you can use a script to complete the task rather than a batch file. VBScript is usually more flexible and easier to debug once you've identified the right objects and API to use for the task.
     
  6. 2007/08/15
    aschwartz

    aschwartz Inactive Thread Starter

    Joined:
    2002/09/26
    Messages:
    23
    Likes Received:
    0
    Thanks for the reply and suggestions. I will streamline it down a bit.

    I had taken a few weeks away from this project, and I noticed that the odd thing is that the backups and copies work they way they are intended to when I run the .bat file manually from that directory on the server. If I try the automation, it does not work. I will try some changes and get back to the group.
     
  7. 2007/08/16
    ReggieB

    ReggieB Inactive Alumni

    Joined:
    2004/05/12
    Messages:
    2,786
    Likes Received:
    2
    Are you using the same account to manually run the bat file and for the scheduled task?
     
  8. 2007/08/16
    aschwartz

    aschwartz Inactive Thread Starter

    Joined:
    2002/09/26
    Messages:
    23
    Likes Received:
    0
    I am. I have a domain admin svc account that I am using. It has rights to all of the directories it touches, as well as the print server and the file location.

    Would DFS help with this in anyway?
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.