D
DennisWage
Guest
I have a .bat file to back up files to a mapped network drive, using robocopy seen below. Works perfectly. It also works using this network address: \\PC-BACKUP\PC-Backup instead of mapped drive.
echo off
setlocal
echo %DATE%_%TIME%
robocopy F:\ Y:\ /NDL /MIR /XD /NP "$RECYCLE.BIN" "System Volume Information" "RECYCLER" /R:0 /W:0 /FFT /A-:SH
rem rundll32.exe powrprof.dll,SetSuspendState 0,1,0
endlocal
<<<The following scheduled task is made with the hope that it will run in sleep mode early AM while I am asleep, and I have tested it completely an thoroughly both with computer awake and in sleep mode.>>>
I set up a scheduled task to run this .bat file. It always works when run manually. It works sometimes when scheduled, and that's what has me baffled. I have found that it works mostly all the time when scheduled anytime during the day, 7am to midnight. But if I schedule it for early morning 1-6am it fails with the dreaded, "The operator has refused the request" error.
I have another scheduled task that does this same thing but backs up to a local drive. It ALWAYS works. So this leads me to think it is something on the network drive end.
The only thing I can come up with is that my windows 10 PC is in some deeper sleep mode at 4am or the linux machine I am backing up to is doing maintenance or in some kind of hyper sleep mode.
Any help will be appreciated.
<?xml version="1.0" encoding="UTF-16"?>
<Task version="1.4" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
<RegistrationInfo>
<Date>2019-10-25T10:43:48.9800929</Date>
<Author>DENNIS-LAPTOP\dwage</Author>
<URI>\Backup Weekly</URI>
</RegistrationInfo>
<Triggers>
<CalendarTrigger>
<StartBoundary>2019-11-13T23:59:00</StartBoundary>
<Enabled>true</Enabled>
<ScheduleByWeek>
<DaysOfWeek>
<Wednesday />
</DaysOfWeek>
<WeeksInterval>1</WeeksInterval>
</ScheduleByWeek>
</CalendarTrigger>
</Triggers>
<Principals>
<Principal id="Author">
<UserId>S-1-5-21-770257158-204139670-28269216-1001</UserId>
<LogonType>Password</LogonType>
<RunLevel>HighestAvailable</RunLevel>
</Principal>
</Principals>
<Settings>
<MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy>
<DisallowStartIfOnBatteries>false</DisallowStartIfOnBatteries>
<StopIfGoingOnBatteries>true</StopIfGoingOnBatteries>
<AllowHardTerminate>true</AllowHardTerminate>
<StartWhenAvailable>false</StartWhenAvailable>
<RunOnlyIfNetworkAvailable>false</RunOnlyIfNetworkAvailable>
<IdleSettings>
<StopOnIdleEnd>true</StopOnIdleEnd>
<RestartOnIdle>false</RestartOnIdle>
</IdleSettings>
<AllowStartOnDemand>true</AllowStartOnDemand>
<Enabled>true</Enabled>
<Hidden>false</Hidden>
<RunOnlyIfIdle>false</RunOnlyIfIdle>
<DisallowStartOnRemoteAppSession>false</DisallowStartOnRemoteAppSession>
<UseUnifiedSchedulingEngine>true</UseUnifiedSchedulingEngine>
<WakeToRun>true</WakeToRun>
<ExecutionTimeLimit>PT72H</ExecutionTimeLimit>
<Priority>7</Priority>
</Settings>
<Actions Context="Author">
<Exec>
<Command>C:\Users\dwage\Desktop\Backup-Weekly.bat</Command>
<Arguments>> C:\Users\dwage\Desktop\Log-Weekly.txt</Arguments>
</Exec>
</Actions>
</Task>
Continue reading...
echo off
setlocal
echo %DATE%_%TIME%
robocopy F:\ Y:\ /NDL /MIR /XD /NP "$RECYCLE.BIN" "System Volume Information" "RECYCLER" /R:0 /W:0 /FFT /A-:SH
rem rundll32.exe powrprof.dll,SetSuspendState 0,1,0
endlocal
<<<The following scheduled task is made with the hope that it will run in sleep mode early AM while I am asleep, and I have tested it completely an thoroughly both with computer awake and in sleep mode.>>>
I set up a scheduled task to run this .bat file. It always works when run manually. It works sometimes when scheduled, and that's what has me baffled. I have found that it works mostly all the time when scheduled anytime during the day, 7am to midnight. But if I schedule it for early morning 1-6am it fails with the dreaded, "The operator has refused the request" error.
I have another scheduled task that does this same thing but backs up to a local drive. It ALWAYS works. So this leads me to think it is something on the network drive end.
The only thing I can come up with is that my windows 10 PC is in some deeper sleep mode at 4am or the linux machine I am backing up to is doing maintenance or in some kind of hyper sleep mode.
Any help will be appreciated.
<?xml version="1.0" encoding="UTF-16"?>
<Task version="1.4" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
<RegistrationInfo>
<Date>2019-10-25T10:43:48.9800929</Date>
<Author>DENNIS-LAPTOP\dwage</Author>
<URI>\Backup Weekly</URI>
</RegistrationInfo>
<Triggers>
<CalendarTrigger>
<StartBoundary>2019-11-13T23:59:00</StartBoundary>
<Enabled>true</Enabled>
<ScheduleByWeek>
<DaysOfWeek>
<Wednesday />
</DaysOfWeek>
<WeeksInterval>1</WeeksInterval>
</ScheduleByWeek>
</CalendarTrigger>
</Triggers>
<Principals>
<Principal id="Author">
<UserId>S-1-5-21-770257158-204139670-28269216-1001</UserId>
<LogonType>Password</LogonType>
<RunLevel>HighestAvailable</RunLevel>
</Principal>
</Principals>
<Settings>
<MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy>
<DisallowStartIfOnBatteries>false</DisallowStartIfOnBatteries>
<StopIfGoingOnBatteries>true</StopIfGoingOnBatteries>
<AllowHardTerminate>true</AllowHardTerminate>
<StartWhenAvailable>false</StartWhenAvailable>
<RunOnlyIfNetworkAvailable>false</RunOnlyIfNetworkAvailable>
<IdleSettings>
<StopOnIdleEnd>true</StopOnIdleEnd>
<RestartOnIdle>false</RestartOnIdle>
</IdleSettings>
<AllowStartOnDemand>true</AllowStartOnDemand>
<Enabled>true</Enabled>
<Hidden>false</Hidden>
<RunOnlyIfIdle>false</RunOnlyIfIdle>
<DisallowStartOnRemoteAppSession>false</DisallowStartOnRemoteAppSession>
<UseUnifiedSchedulingEngine>true</UseUnifiedSchedulingEngine>
<WakeToRun>true</WakeToRun>
<ExecutionTimeLimit>PT72H</ExecutionTimeLimit>
<Priority>7</Priority>
</Settings>
<Actions Context="Author">
<Exec>
<Command>C:\Users\dwage\Desktop\Backup-Weekly.bat</Command>
<Arguments>> C:\Users\dwage\Desktop\Log-Weekly.txt</Arguments>
</Exec>
</Actions>
</Task>
Continue reading...