Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Problem with Scheduled Task

Options
  • 05-09-2012 11:34am
    #1
    Registered Users Posts: 440 ✭✭


    Hi All,

    I have a problem at the moment and I am looking for some suggestions from the brainboxes on on the forum. Situation is as follows

    ServerA Win2K8 Folder with files to be backed up
    ServerB Win2K3 Server with backup tape and Software
    Z: mapped to ServerA backup folder

    I need to backup the folder on ServerA using the tape drive and software connected to ServerB. The problem is that it's not licensed to backup mapped drives or remote shares.

    Solution or so I thought is to map a drive to the folder I want backed up. Then create a bat file which xcopys the files to the ServerB from ServerA (z:) and then backup the files.

    I created the bat file and tested and works no problems when I double click it but it will not work as a scheduled task (gives a 0x4 error)

    Anything I have looked up suggests that I need to create a user with access to the share and run the scheduled task as that user. I am trying to run it as Administrator.

    The problem is that while these servers can see each other, they are not on a domain and not on the same workgroup so I can't create a common user that will work.

    Any suggestions would be apreciated.


Comments

  • Registered Users Posts: 3,424 ✭✭✭jamesd


    Can you put the username in the format DomainName\Administrator ?


  • Registered Users Posts: 440 ✭✭djd80


    jamesd wrote: »
    Can you put the username in the format DomainName\Administrator ?

    Nope, they are not on a domain and not on a common workgroup either. I tried using the credentials for ServerA in that format but no dice.


  • Moderators, Arts Moderators, Regional Abroad Moderators Posts: 11,022 Mod ✭✭✭✭Fysh


    Have you tried a batch file for just the xcopy task using an account with access to the share? If that works, your best bet would be to have a first batch script which creates a log file, calls a second batch script to run as the user with share access and run the xcopy job, then revert back to the first script which then proceeds with the backup process.

    A less desirable option you may still have to consider - can the folder on ServerA be made readable to all users?


  • Registered Users Posts: 440 ✭✭djd80


    Hi All

    Thanks for the replies, finally got this working today.

    It won't work with a drive which is already mapped but if you map the drive within the script you are calling it seems to work fine. Just disconnect it at the end of the bat file and you're done. See the commands below :


    net use z: \\servername\sharename /USER:username password
    xcopy z:\*.* e:\folder\*.* /y /e /r /c /h /d
    net use z: /delete
    exit


Advertisement