Hello everyone,
I've been having a strange problem recently that leaves me somewhat befuddled.
Our SQL Server creates backup files of its databases every night, which works just fine.
However, for some reason - I am not sure why, but our ERP/Database guy tells me so - SQL Server can only write its backup files to a local hard drive, which strikes me as kind of brain damaged, but but there is nothing I can do about it. Until recently, another admin used to move the backup files to our NAS manually once a week or so, but then he asked me to write a script to automate this task. Which should be quite trivial.
While working on the script - without a decent Unix shell it can be surprisingly difficult - I came across robocopy, which I admit is a great tool. I rewrote the script using robocopy, gave it a try, and voila - it worked! :D
So I created a Task in the Scheduler to run nightly a few hours after the database backup job, but for about two weeks now, every morning, there were the backup files still on the SQL Server machine.
The log file left behind by robocopy says something about Permission Denied (Error 5 or something like that). I've told the Task Scheduler to run my Script as the Domain Administrator account. When I run the script manually in an Administrator shell, it works just fine. But when run from the Task scheduler, it does not.
Is there something obvious or subtle I am missing? Or does the task scheduler not allow running tasks as Administrator?
Thank you very much for all and any input you feel like sharing!