Re: Schedule Task



Yes, this is possible. I do it with my own server and with my clients'
servers. First, here is a sample script. Adapt as necessary - your
mileage may vary (note that some lines are wrapped by the newsreader -
you will need to unwrap them):

- - - - -
:: Hard Disk Defragmentation Script
:: Author: Owen Williams
:: As of: 18-Jan-2005
::
:: Set DateDay environment variable to the current date & day, e.g.,
:: 20040518-Tue
::
For /F "Tokens=1-4 Delims=/ " %%i In ('Date /T') Do
Set DateDay=%%l%%j%%k-%%i
ChDir %SBSProgramDir%\Support\Defrag Logs
Echo Hard Disk Defragmentation Report for %DateDay%
>SBSDefrag%DateDay%.log
Echo Defragmentation Results for Drive C >>SBSDefrag%DateDay%.log
Defrag C: -v >>SBSDefrag%DateDay%.log
Echo Defragmentation Results for Drive D >>SBSDefrag%DateDay%.log
Defrag D: -v >>SBSDefrag%DateDay%.log
::
:: Clean up the %SBSProgramDir%\Administration\Defrag Logs folder so
:: it contains only the most recent 4 log files.
::
:: Dir SBSDefrag*.log /B /O:-N >LogFiles.txt - Sends a list of
:: SBSDefrag file names only (/B) sorted in descending order
:: (/O:-N) to LogFiles.txt
:: For /F "Skip=4" %%f In (LogFiles.txt) Do Del %%f - Skips the first 4
:: lines of LogFiles.txt (i.e., skips the 4 newest SBSDefrag files),
:: then deletes any older files.
::
Dir SBSDefrag*.log /B /O:-N >LogFiles.txt
For /F "Skip=4" %%f In (LogFiles.txt) Do Del %%f
Del LogFiles.txt
- - - - -

Save the script in a file, e.g., SBS_Defrag.CMD.

Then, launch Start | All Programs | Accessories | System Tools |
Scheduled Tasks. Double-click Add Scheduled Task and browse to
SBS_Defrag.CMD. Set your scheduling specifications and you're good to
go.

Now, if you're asking "Can the scheduling be DYNAMIC and start at
various times, but only when usage is low", the answer is "no." You
need to know a day of the week and time of the day when usage will
usually be low. I usually select something like 6:30AM on Sunday
morning, but it really depends on the business. You should not schedule
a defrag to run while [1] a backup is running, [2] Exchange is running
information store maintenance or [3] a volume shadow copy is being taken
[by default on SBS, 7:00AM and 12:00noon].

-- Owen Williams

In article <C0BCD0B4-A353-424D-8165-10D46952F2CD@xxxxxxxxxxxxx>,
Terry1337@xxxxxxxxxxxxxxxxxxxxxxxxx says...
Is it possible to schedule a task to run defrag on needed drives at a certain
time when useage is low? If so how do I set it up?

Thanks!
.



Relevant Pages

  • Re: Two-way MySQL <--> FM9 connection Options, part II
    ... and running in my FMAS. ... Meaning a client machine set up with a scheduling plug-in like Troi ... The plugin triggers the script to run at a certain time, ... import is done on the client machine, not the server. ...
    (comp.databases.filemaker)
  • Re: PHP time monitor
    ... that could be solved with logging, but I haven't attempted it yet so I'm ... I had originally envisioned the idea that a script would ... certain time was reached the script would execute. ... > Scheduling is better done with OS-level scheduling facilities such ...
    (alt.php)
  • Re: Scheduled task onlogon monthly?
    ... This page includes a link for a free download of Windows Script ... simple programs to facilitate some special scheduling needs. ... into standby before my all of my scheduled jobs can run. ...
    (microsoft.public.windowsxp.general)
  • [ANN] Script Timer 2.4 Released
    ... Script Timer is a user friendly script, Automator workflow, and ... scheduling, independent Automator workflow scheduling, and other ... Script Timer lets you schedule the execution of AppleScript, perl, and ...
    (comp.sys.mac.system)
  • Re: Scripting for cleanup utilities run by Task Scheduler on logge
    ... You can delete any file while the user is logged off by scheduling ... > OK, I will consider your warnings on defrag, I've seen debates on its ... > The other part of my script is intended to delete temp files using the ... >> defrag operation then you might lose your whole disk. ...
    (microsoft.public.win2000.general)