Intro Download and install Frequently Asked Questions Tips and tricks

Homepage







© J.C. Kessels 2009
MyDefrag Forum
May 24, 2013, 10:38:47 am *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Question about a script  (Read 739 times)
dmagician
Newbie
*
Posts: 1


View Profile
« on: October 23, 2009, 06:30:09 am »

Hello all.

I have a question: I've written a script to defrag my second hard-disk which holds all the directory
for 'My Documents' (Frequent usage - every day), some ISO's/Setups and ghost for my primary disk (which are low usage).

The script is:
Code:
Title("Defragment of my Secondary ('My Documents', instalations, setups etc.) drive")
Description("Defragment of my Secondary ('My Documents', instalations, setups etc.) drive")

WriteLogfile("C:\Program Files\MyDefrag v4\Scripts\MyDocsDefrag.LOG","LogHeader")

VolumeSelect
  CommandlineVolumes()
  and Writable(yes)
  and Mounted(yes)
VolumeActions
  AppendLogfile("C:\Program Files\MyDefrag v4\Scripts\MyDocsDefrag.LOG","LogBefore")

AppendLogfile("C:\Program Files\MyDefrag v4\Scripts\MyDocsDefrag.LOG",
"-------------------------------------------------------------------------------------------------------------------------------------------

UnMovable:
List:
!UnmovablesList!

Total # of fragments: !UnmovablesTotalFragments!
Total # of bytes: !UnmovablesTotalBytes!
Total # of clusters: !UnmovablesTotalClusters!
-------------------------------------------------------------------------------------------------------------------------------------------")

AppendLogfile("C:\Program Files\MyDefrag v4\Scripts\MyDocsDefrag.LOG", "Deleting journal")
DeleteJournal()

  /* Reclaim the NTFS reserved area by moving non-system files to regular diskspace. */
AppendLogfile("C:\Program Files\MyDefrag v4\Scripts\MyDocsDefrag.LOG", "Reclaim the NTFS reserved area by moving non-system files to regular diskspace")
  ReclaimNtfsReservedAreas()

  # Zone 1 - NTFS system files (such as the $MFT) and a small gap.
AppendLogfile("C:\Program Files\MyDefrag v4\Scripts\MyDocsDefrag.LOG",
"
Proccessing Zone 1 - NTFS system files (such as the $MFT) and a small gap.")
  FileSelect
    SelectNtfsSystemFiles(yes)
  FileActions
    PlaceNtfsSystemFiles(Ascending)
FastFill()
    AddGap(Megabytes(250))
  FileEnd

# Zone 2 - Directories
AppendLogfile("C:\Program Files\MyDefrag v4\Scripts\MyDocsDefrag.LOG",
"
Proccessing Zone 2 - Directories")
  FileSelect
    Directory(yes)
  FileActions
    SortByName(Ascending)
    AddGap(Megabytes(250))
  FileEnd

# Zone 3 - Documents (e.g. "My Documents" located under "Documents")
AppendLogfile("C:\Program Files\MyDefrag v4\Scripts\MyDocsDefrag.LOG",
"
Proccessing Zone 3 - Documents (e.g. 'My Documents' located under 'Documents')")
FileSelect
DirectoryName("Documents")
FileActions
//SortByName(Ascending)
//MoveDownFill()
Defragment(Fast)
FastFill()
AddGap(Megabytes(3000))
FileEnd

# Zone 4 - IIS projects
AppendLogfile("C:\Program Files\MyDefrag v4\Scripts\MyDocsDefrag.LOG",
"
Proccessing Zone 4 - IIS projects")
FileSelect
DirectoryName("IIS")
FileActions
//SortByName(Ascending)
//MoveDownFill()
Defragment(Fast)
FastFill()
AddGap(Megabytes(2000))
FileEnd

# Zone 5 - ALL that is NOT under 'Installations', 'Ghost', 'Documents' or 'IIS'
AppendLogfile("C:\Program Files\MyDefrag v4\Scripts\MyDocsDefrag.LOG",
"
Proccessing Zone 5 - ALL that is NOT under 'Installations', 'Ghost', 'Documents' or 'IIS'")
  FileSelect
ALL AND
NOT (DirectoryName("Installations")) AND
NOT (DirectoryName("Ghost")) AND
NOT (DirectoryName("Documents")) AND
NOT (DirectoryName("IIS"))
  FileActions
//SortByName(Ascending)
//MoveDownFill()
FastFill()
AddGap(PercentageOfVolumeFree(80))
  FileEnd

# Zone 6 - ALL under "Installations" (big instalation files, low usage) or "Ghost" (big backup files (Ghost/TrueImage), low usage)
AppendLogfile("C:\Program Files\MyDefrag v4\Scripts\MyDocsDefrag.LOG",
"
Proccessing Zone 6 - ALL under 'Installations' (big instalation files, low usage) or 'Ghost' (big backup files (Ghost/TrueImage), low usage)")
FileSelect
NOT (ALL) AND
(
DirectoryName("Installations") OR
DirectoryName("Ghost")
) AND
NOT (DirectoryName("Documents")) AND
NOT (DirectoryName("IIS"))
FileActions
Defragment(Fast)
FastFill()
AddGap(PercentageOfVolumeFree(20))
FileEnd

AppendLogfile("C:\Program Files\MyDefrag v4\Scripts\MyDocsDefrag.LOG",
"-------------------------------------------------------------------------------------------------------------------------------------------
UnMovable:
List: !UnmovablesList!
Total # of fragments: !UnmovablesTotalFragments!
Total # of bytes: !UnmovablesTotalBytes!
Total # of clusters: !UnmovablesTotalClusters!
-------------------------------------------------------------------------------------------------------------------------------------------")

VolumeEnd

 AppendLogfile("C:\Program Files\MyDefrag v4\Scripts\MyDocsDefrag.LOG","LogAfter")


And it takes forever to finish and even after finish the drive looks pretty fragmented...

Any advice?


                                                                                                   Thanks ahead,
                                                                                                            D.
Logged
jeroen
Administrator
JkDefrag Hero
*****
Posts: 7155



View Profile WWW
« Reply #1 on: October 23, 2009, 07:26:14 am »

For more information see MyDefrag is very slow, what speed can I expect? MyDefrag uses wrap-around fragmentation, a concept unique to MyDefrag. The DefragmentOnly script will turn this setting off and is the only script that is more or less compatible with other defragmenters. For more information see the IgnoreWrapAroundFragmentation setting.
Logged
Kasuha
JkDefrag Hero
*****
Posts: 595


View Profile
« Reply #2 on: October 23, 2009, 08:40:11 am »

Code:
# Zone 5 - ALL that is NOT under 'Installations', 'Ghost', 'Documents' or 'IIS'
AppendLogfile("C:\Program Files\MyDefrag v4\Scripts\MyDocsDefrag.LOG",
"
Proccessing Zone 5 - ALL that is NOT under 'Installations', 'Ghost', 'Documents' or 'IIS'")
  FileSelect
ALL AND
NOT (DirectoryName("Installations")) AND
NOT (DirectoryName("Ghost")) AND
NOT (DirectoryName("Documents")) AND
NOT (DirectoryName("IIS"))
  FileActions
//SortByName(Ascending)
//MoveDownFill()
FastFill()
AddGap(PercentageOfVolumeFree(80))
  FileEnd

Your Zone 5 does not have any defragmenting or sorting command so it only defragments files if it moves them to a gap. I believe that is the problem.
Logged
Pages: [1]
  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!