Intro Download and install Frequently Asked Questions Tips and tricks

Homepage







© J.C. Kessels 2009
MyDefrag Forum
May 20, 2013, 09:21:28 pm *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: 1 [2]
  Print  
Author Topic: Script - simple daily version  (Read 3996 times)
redrock5432
JkDefrag Supporter
***
Posts: 10


View Profile
« Reply #15 on: January 07, 2010, 02:01:17 am »

Well, after lots of feedback and some experiments I have reverted to much of the Optimize Daily script that comes with MyDefrag.
Starting with Optimize Daily, I changed the following.
1. removed ReclaimNtfsReservedAreas() [removed in next release]
2. zone 1 - set gap to start 30% of volumesize [doesn't move on each run.]
3. zone 2 - no change
3. zone 3 - limited to max of 5MB files [several large files in Layout.ini kept getting moved on each run.
4. zone 4 - added  exclusions for *.jpg, *.jpeg, *.dmp, *.tmp, *.torrent, *.nsf", *.m4a, *.zip, *.png, *.uif, *.msp
5. zone 5 - limited size to 50MB [most of the spacehogs]
6. zone 6 - new zone. do Fastfill() first then defrag. [Uber hogs. prevents movement of large files twice in same run.]

The previous changes reduced the movement of large files, some 2GB. Script does not produce perfect disk but does failrly well and runs fast compared to 'stock' Optimize Daily.

Script still spends lots of time ordering directories. It would be nice if FastFill() had an option to move up as well as move down files. I would use that option for the directories, zone 2. It is not clear that sorting directories has a performance advantage over directories collected together and contiguous.

As usual comments welcomed.

Code:
# MyDefrag v4.0 default script: Optimize Daily
# v03 - added new zone prior to end and removed fastfill from last zone.
# removed reclaim NTFS
# This script is part of the standard MyDefrag distribution.


Title('Optimize Daily medium v03')
Description("Optimize Daily description")   // See the "Settings.MyD" file.


/* Write the header to the logfile. See the "Settings.MyD" file for the
   definition of the "LogHeader" string. */
WriteLogfile("MyDefrag.log","LogHeader")

/* Select and process the volumes one by one. */
VolumeSelect
  CommandlineVolumes()
  and Removable(no)
  and Writable(yes)
  and Mounted(yes)
VolumeActions

  /* Write the "before" statistics to the logfile. See the "Settings.MyD" file
     for the definition of the "LogBefore" string. */
  AppendLogfile("MyDefrag.log","LogBefore")

  /* Place files at 30% into the disk. */
  MakeGap(VolumeSize * 0.3, DoNotVacate)

  /* Zone 1: Place the MFT and some other special NTFS files. */
  FileSelect
    SelectNtfsSystemFiles(yes)
  FileActions
    PlaceNtfsSystemFiles(Ascending,MftSize * 0.1)
  FileEnd

  /* Zone 2: Directories. (FastFill would be ok but does not work on re-located zones*/
  FileSelect
    Directory(yes)
  FileActions
    SortByName(Ascending)
  FileEnd

  /* Place files at the beginning of the disk. */
  MakeGap(0)

  /* Zone 3: files used when booting, and a gap. */
  FileSelect
    ImportListFromBootOptimize() and Size(0,5MB)
  FileActions
    Defragment(Fast)
    FastFill()
    AddGap(RoundUp(ZoneEnd,VolumeFree * 0.1))
  FileEnd

  /* Zone 4: regular files and a gap. */
  FileSelect
    not(
      Size(50000000,0)
      or (LastAccessEnabled(yes) and LastAccess(,1 month ago))
      or DirectoryName("$RECYCLE.BIN")
      or DirectoryName("RECYCLED")
      or DirectoryName("RECYCLER")
      or DirectoryName("$*")
      or DirectoryName("Downloaded Installations")
      or DirectoryName("Ehome")
      or DirectoryName("Fonts")
      or DirectoryName("Help")
      or DirectoryName("I386")
      or DirectoryName("IME")
      or DirectoryName("Installer")
      or DirectoryName("ServicePackFiles")
      or DirectoryName("SoftwareDistribution")
      or DirectoryName("Speech")
      or DirectoryName("Symbols")
      or DirectoryName("ie?updates")
      or DirectoryName("dllcache")
      or DirectoryName("Installshield Installation Information")
      or DirectoryName("System Volume Information")
      or DirectoryName("windows.old")
      or FileName("*.7z")
      or FileName("*.arj")
      or FileName("*.avi")
      or FileName("*.bak")
      or FileName("*.bup")
      or FileName("*.bz2")
      or FileName("*.cab")
      or FileName("*.chm")
      or FileName("*.dvr-ms")
      or FileName("*.gz")
      or FileName("*.ifo")
      or FileName("*.iso")
      or FileName("*.log")
      or FileName("*.lzh")
      or FileName("*.mp3")
      or FileName("*.msi")
      or FileName("*.old")
      or FileName("*.pdf")
      or FileName("*.rar")
      or FileName("*.rpm")
      or FileName("*.tar")
      or FileName("*.wav")
      or FileName("*.wmv")
      or FileName("*.vob")
      or FileName("*.z")
      or FileName("*.jpg")
      or FileName("*.jpeg")
      or FileName("*.dmp")
      or FileName("*.tmp")
      or FileName("*.torrent")
      or FileName("*.nsf")
      or FileName("*.m4a")
      or FileName("*.zip")
      or FileName("*.png")
      or FileName("*.uif")
      or FileName("*.msp")
      )
  FileActions
    Defragment(Fast)
    FastFill()
    AddGap(RoundUp(ZoneEnd,VolumeFree * 0.1))
  FileEnd

/* Zone 5: regular files and a gap. */
  FileSelect
      Size(0,50MB)
  FileActions
    Defragment(Fast)
    FastFill()
    AddGap(RoundUp(ZoneEnd,VolumeFree * 0.1))
  FileEnd

  /* Zone 6: spacehog files (less important files that take up a lot of space). */
  FileSelect
    all
  FileActions
    FastFill()
    Defragment(Fast)
  FileEnd

  /* Write the "after" statistics to the logfile. See the "Settings.MyD" file
     for the definition of the "LogAfter" string. */
  AppendLogfile("MyDefrag.log","LogAfter")

VolumeEnd

« Last Edit: January 07, 2010, 06:02:11 am by redrock5432 » Logged
jeroen
Administrator
JkDefrag Hero
*****
Posts: 7155



View Profile WWW
« Reply #16 on: January 07, 2010, 02:21:32 am »

Well, after lots of feedback and some experiments I have reverted to much of the Optimize Daily script that comes with MyDefrag.
Smiley Looking back we see what a convoluted and arduous path we have followed, and how close the solution is to the problem. Still, I hope you found it an interesting journey.
Logged
redrock5432
JkDefrag Supporter
***
Posts: 10


View Profile
« Reply #17 on: January 07, 2010, 02:36:04 am »

Updated my earlier post. The original was only a partial. Full post now in thread. Sorry for posting error.
Logged
theantagonizer
JkDefrag Senior
****
Posts: 25


View Profile
« Reply #18 on: January 17, 2010, 12:40:01 am »

Ill be honest with you, this script didnt quite do what I was under the impression it would. Its not a bad script. It just has some quirks. Is it working well for you?
Logged
redrock5432
JkDefrag Supporter
***
Posts: 10


View Profile
« Reply #19 on: January 17, 2010, 05:38:04 am »

I have changed the script again. I will post soon.

Basically the idea that I am trying to optimize is to have a script that in successive runs moves the fewest files while achieving 'most' of the performance increases.

I have a about 5 files that are over 1GB that I noticed were being moved every run and sometimes twice in the same run. This and other activity got me thinking I might be able to do better.

Thank everyone for feedback.
Logged
theantagonizer
JkDefrag Senior
****
Posts: 25


View Profile
« Reply #20 on: January 23, 2010, 06:59:10 pm »

I am looking forward to your updated release. I have been watching your thread as I also have the problem of a few large files getting moved a lot.
Logged
redrock5432
JkDefrag Supporter
***
Posts: 10


View Profile
« Reply #21 on: April 22, 2010, 08:39:59 pm »

Well it has been awhile. I found I was getting too complicated in my scripts without much payback. I have finally landed on this version. Not perfect but it has really made the HD quieter. My original goal was to not move so many files on each defrag but that was hard to do, at least for me. I decided go for a simple script that did 'most' of what I wanted. Some big files do get moved twice but I just let that be a 'cost' of defrag.

Thanks for all the help and comments provided.
Code:
# MyDefrag script: red rock
# simple script to use daily if required but usually only weekly
# HD repartitioned into paging file and everything else:
# My case - 250 GB HD. 2 GB partion in fastest area formated FAT used for paging file. remainder used for OS and data formated NTFS
# some new file extensions and directories added to 'hog' filter
# uses layout.ini for the first zone


Title('red rock daily/weekly v03')
Description("red rock daily/weekly v03")   // See the "Settings.MyD" file.


/* Write the header to the logfile. See the "Settings.MyD" file for the
   definition of the "LogHeader" string. */
WriteLogfile("MyDefrag.log","LogHeader")

/* Select and process the volumes one by one. */
VolumeSelect
  CommandlineVolumes()
  and Removable(no)
  and Writable(yes)
  and Mounted(yes)
  and Name("c:")
VolumeActions

  /* Write the "before" statistics to the logfile. See the "Settings.MyD" file
     for the definition of the "LogBefore" string. */
  AppendLogfile("MyDefrag.log","LogBefore")

  MakeGap(0)


/* Zone 1: files used when booting, remaining files and a gap. */
  FileSelect
    ImportListFromBootOptimize()
  FileActions
    defragment(fast)
    fastfill()
  FileEnd

  makegap(RoundUp(ZoneEnd + .001 * VolumeFree, VolumeFree * 0.001))

 /* Zone 2: Directories. */
  FileSelect
    Directory(yes)
  FileActions
    defragment(fast)
    fastfill()
  FileEnd

  makegap(RoundUp(ZoneEnd + .001 * VolumeFree, VolumeFree * 0.001))

  /* Zone 3: Place the MFT and some other special NTFS files. */
  FileSelect
    SelectNtfsSystemFiles(yes)
  FileActions
    PlaceNtfsSystemFiles(Ascending,MftSize * 0.1)
  FileEnd


  makegap(RoundUp(ZoneEnd + .001 * VolumeFree, VolumeFree * 0.001))


 /* Zone 4: recent 1 month and not hogs types */
FileSelect
    (LastAccessEnabled(yes) and LastAccess(1 months ago, now))
    and
    not(DirectoryName("$RECYCLE.BIN")
      or DirectoryName("RECYCLED")
      or DirectoryName("RECYCLER")
      or DirectoryName("$*")
      or DirectoryName("Downloaded Installations")
      or DirectoryName("Ehome")
      or DirectoryName("Fonts")
      or DirectoryName("Help")
      or DirectoryName("I386")
      or DirectoryName("IME")
      or DirectoryName("Installer")
      or DirectoryName("ServicePackFiles")
      or DirectoryName("SoftwareDistribution")
      or DirectoryName("Speech")
      or DirectoryName("Symbols")
      or DirectoryName("ie?updates")
      or DirectoryName("dllcache")
      or DirectoryName("Installshield Installation Information")
      or DirectoryName("System Volume Information")
      or DirectoryName("windows.old")
      or DirectoryName("tools*")
      or FileName("*.7z*")
      or FileName("*.arj")
      or FileName("*.avi")
      or FileName("*.bak")
      or FileName("*.bup")
      or FileName("*.bz2")
      or FileName("*.cab")
      or FileName("*.chm")
      or FileName("*.dvr-ms")
      or FileName("*.gz")
      or FileName("*.ifo")
      or FileName("*.iso")
      or FileName("*.log")
      or FileName("*.lzh")
      or FileName("*.mp3")
      or FileName("*.msi")
      or FileName("*.old")
      or FileName("*.pdf")
      or FileName("*.rar")
      or FileName("*.rpm")
      or FileName("*.tar")
      or FileName("*.wav")
      or FileName("*.wmv")
      or FileName("*.vob")
      or FileName("*.z")
      or FileName("*.zip")
      or FileName("*.pgp")
      or FileName("*.uif")
      or FileName("*.m4a")
      or FileName("*.jpg")
      or FileName("*.jpeg")
      or FileName("*.tif")
      or FileName("*.bkup")
      or FileName("*.nsf*")
      )
  FileActions
    defragment(fast)
    fastfill()
  FileEnd

  makegap(RoundUp(ZoneEnd + .001 * VolumeFree, VolumeFree * 0.001))


/* Zone 5: recent and hogs and a gap. */
  FileSelect
      LastAccessEnabled(yes) and LastAccess(1 month ago,now)
  FileActions
    defragment(fast)
    fastfill()
  FileEnd

  makegap(RoundUp(ZoneEnd + .001 * VolumeFree, VolumeFree * 0.001))


 /* Zone 6: old */
  FileSelect
    all
  FileActions
    defragment(fast)
    fastfill()
  FileEnd

  /* Write the "after" statistics to the logfile. See the "Settings.MyD" file
     for the definition of the "LogAfter" string. */
  AppendLogfile("MyDefrag.log","LogAfter")

VolumeEnd

Logged
guybrush7
Newbie
*
Posts: 1


View Profile
« Reply #22 on: April 23, 2010, 03:13:58 pm »

I love your script!!!  Shocked

My computer is very very fast now, from booting time to open file/programs. Thanks!
Logged
Pages: 1 [2]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.5 | SMF © 2006-2008, Simple Machines LLC Valid XHTML 1.0! Valid CSS!