Robocopy fails in Scheduled task with ERROR 1326 Logon failure
- by reticentKoala
My aim: To simply mirror a database backup directory onto another server
Approach: Use Robocopy statement contained in a scheduled task
robocopy "C:\MylocalDirBackup" "\\MY.IP\DatabaseBackupsShare" /mir /z /log:"C:\MyLocalDIR\RobocopyTestLog.txt"
Environment:
Windows Server 2008R2
Scheduled task user "MylocalUser": Local adminon local machine
Network config: Both servers on workgroup
Tests:
navigate to share \MY.IP\DatabaseBackupsShare as "MylocalUser" -
success, no prompt for credentials
Run robocopy command from command line when logged on as
"MyLocalUser" - success
The Problem!:
When running Robocopy command from a scheduled task the following error is raised:
2013/10/22 20:04:57 ERROR 1326 (0x0000052E) Accessing Destination Directory \\MY.IP\DatabaseBackupsShare\ Logon failure: unknown user name or bad password.
I found several other people who are having similar problems, and followed suggestions here: http://social.technet.microsoft.com/Forums/scriptcenter/en-US/b591346e-3ed0-4ed1-9453-24851ebe1bb1/scheduling-robocopy-to-run-at-system-startup?forum=ITCG
Any help gratefully received. I thought this was going to be a quick task...