Forum Discussion
Nivlee
Feb 26, 2019Copper Contributor
Windows Server ScheduledDefrag Task Schedule not running
All my Windows server (2008 R2 and above) unable to run scheduled task of disk defragmentation? I had turn on the schedule defragmentation in disk defragmenter and set it run on weekly basic, but, it...
rob_nicholson_helios
Jan 05, 2020Copper Contributor
Nivlee I came across the same problem on our two Windows 2012 servers. Defrag had never been run and I suspect the reason is that there is no trigger on the ScheduledDefrag task which means it'll never run automatically. Changing the schedule in the optimisation tool from weekly to daily doesn't make any difference. I suspect this is a bug that's been around a long time...
I'm about to add a trigger to run it once a week and see what happens.
rob_nicholson_helios
Jan 05, 2020Copper Contributor
I read elsewhere that the -$ flag indicates to defrag.exe that it's running as a scheduled task. It must make it do something different to when run from command line.
- david837-_Jan 16, 2020Copper Contributor
In general, some other scheduled task (don't know which) runs ScheduledDefrag. That is why its triggers are empty. I suppose, with some care, triggers could be added. It is too bad that Microsoft allows but doesn't show such cascaded schedules.