ExpertAssist
asked on
Microsoft, Task Scheduler, Result: The task completed with an exit code of (b)
A task has been scheduled in Task Scheduler to run a batch file that calls a Robocopy script. The script copies files from one directory on the server to another directory on the same server, nightly. The Task Scheduler is executed by the domain admin account.
GIS.txt
GIS.txt
1) has this worked in the past ?
2) Wat has changed ?
3) Does a manual run have issues ?
Mostly errors are caused by permissions of the task scheduled, and the context of the user.
4.Does this script create a log? If not, could you change it so it does create a log - writing to the log every so often. Then you could look at the log and see the last portion that ran successfully.
5.Notmally these error msgs will be generated because the script may try to insert nulls into fields that were not setup to allow null values
also ref these stuffs,
https://www.experts-exchange.com/questions/22034171/Scheduled-task-did-not-run-not-clear-as-to-why.html
2) Wat has changed ?
3) Does a manual run have issues ?
Mostly errors are caused by permissions of the task scheduled, and the context of the user.
4.Does this script create a log? If not, could you change it so it does create a log - writing to the log every so often. Then you could look at the log and see the last portion that ran successfully.
5.Notmally these error msgs will be generated because the script may try to insert nulls into fields that were not setup to allow null values
also ref these stuffs,
https://www.experts-exchange.com/questions/22034171/Scheduled-task-did-not-run-not-clear-as-to-why.html
ASKER
The following are the entries in the log file.
GISCOPY.job" (GISCOPY.bat)
Started 8/3/2008 6:00:01 PM
"GISCOPY.job" (GISCOPY.bat)
Finished 8/3/2008 6:05:24 PM
Result: The task completed with an exit code of (b).
I added a dumby file for testing and ran the script manually. The file copied. Then I renamed the dumby file and tried running the script again. Again the dumby file copied. It does appear that the script is running using the Task Scheduler. What I noticed in the Robocopy log is that some of the files cannot be copied because they are in use. Could this be the reason for the (b) exit code?
GISCOPY.job" (GISCOPY.bat)
Started 8/3/2008 6:00:01 PM
"GISCOPY.job" (GISCOPY.bat)
Finished 8/3/2008 6:05:24 PM
Result: The task completed with an exit code of (b).
I added a dumby file for testing and ran the script manually. The file copied. Then I renamed the dumby file and tried running the script again. Again the dumby file copied. It does appear that the script is running using the Task Scheduler. What I noticed in the Robocopy log is that some of the files cannot be copied because they are in use. Could this be the reason for the (b) exit code?
ASKER
Do you know what the /c switch stands for?
/copy:<CopyFlags>
Specifies the file properties to be copied. The following are the valid values for this option:
D Data
A Attributes
T Time stamps
S NTFS access control list (ACL)
O Owner information
U Auditing information
The default value for CopyFlags is DAT (data, attributes, and time stamps).
Specifies the file properties to be copied. The following are the valid values for this option:
D Data
A Attributes
T Time stamps
S NTFS access control list (ACL)
O Owner information
U Auditing information
The default value for CopyFlags is DAT (data, attributes, and time stamps).
Desciptions of optionss available in robocopy
http://technet2.microsoft.com/windowsserver2008/en/library/d4c6e8e9-fcb3-4a4a-9d04-2d8c367b63541033.mspx?mfr=true
http://technet2.microsoft.com/windowsserver2008/en/library/d4c6e8e9-fcb3-4a4a-9d04-2d8c367b63541033.mspx?mfr=true
ASKER
I checked the Robocopy commands and I have the /Copy:Dat configured. After more testing, it appears that the error is a result of open files not copying to the new directory. I may need to find another solution besides Robocopy.
you have to go for a open file agent backup solution...
ASKER
Do you have any suggestions? We are using Netbackup for backing up files, but I don't have a solution that I can use with a batch file to backup and restore files over the night.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I am not comfortable doing the open file backup using script.... I would better suggest you to have a deep look in to the Netbackup and utlizise its own backup file agent... I am sure Netback supports customized backup script
ASKER
Great information! Thanks.
https://www.experts-exchange.com/questions/20705869/The-task-completed-with-an-exit-code-of-1.html