Intro Download and install Frequently Asked Questions Tips and tricks

Homepage







© J.C. Kessels 2009
MyDefrag Forum
May 18, 2013, 12:32:40 pm *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: unnecessary moving with MoveToEndOfDisk()  (Read 993 times)
Bart Welson
JkDefrag Senior
****
Posts: 25


View Profile
« on: March 27, 2012, 08:31:02 pm »

Hi, i currently have the following script, which would do somewhat what the default scripts would do, with 1 difference :
- Do the default operations from the default script
...BUT...
- Make sure to put these 3 things to the very end (slowest part) of the partition.
    - DirectoryPath("C:\delen\ExcellsFun")
    - DirectoryPath("C:\delen\Backups van TOPPY-PC\DOWN")
    - Size(1000000000,0)


However, even when the script seems to position these at the very end of the partition after all, they are getting moved with each previous zone.

For example :

When it finds these files in zone3, during zone 3 operation they are moved to the position of where zone 4 starts, then....
When it finds these files in zone4, during zone 4 operation they are moved to the position of where zone 5 starts, then....
When it finds these files in zone5, during zone 5 operation they are moved to the position of where zone 6 starts, then....
When it finds these files in zone6, during zone 6 operation they are moved to the position of where zone 7 starts, then....
They are finally moved another time to the actually end of the partition.

as you see, instead of just putting any of these files directly to the end of the partition, in whatever zone it is currently being processed, it is actually moving these (huge) file 5 (FIVE!) TIMES instead of just placing them at the end whenever it finds them.

Please,

1) what am I doing wrong here. and...
2) is it allowed, and should this work, by placing the MoveToEndOfDisk() part at the very beginning of my script, so that the next zones will no longer have to move them over and over ?

Thanks for any help.
            Greetings, Bart.
           


This is the script :
Code:
# MyDefrag v4.0 default script: System Disk Daily
#
# This script is part of the standard MyDefrag distribution.

Title('System Disk Daily')
Description("System Disk 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()
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 data on the disk. */
  MakeGap(RoundUp(VolumeUsed * 0.3,VolumeSize * 0.01), 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. */
  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
Not (
DirectoryPath("C:\delen\ExcellsFun") or DirectoryPath("C:\delen\Backups van TOPPY-PC\DOWN")
    )
  FileActions
    Defragment(Fast)
    FastFill()
    AddGap(RoundUp(ZoneEnd,VolumeFree * 0.01))
  FileEnd

  /* Zone 4: files used by the most used programs, and a gap. */
  FileSelect
    ImportListFromProgramHints("*.pf")
    and
Not (
DirectoryPath("C:\delen\ExcellsFun") or DirectoryPath("C:\delen\Backups van TOPPY-PC\DOWN")
)
  FileActions
    Defragment(Fast)
    FastFill()
    AddGap(RoundUp(ZoneEnd,VolumeFree * 0.01))
  FileEnd

  /* Zone 5: regular files and a gap. */
  FileSelect
    not(
      Size(1000000000,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("*.zip")
      or DirectoryPath("C:\delen\ExcellsFun")
      or DirectoryPath("C:\delen\Backups van TOPPY-PC\DOWN")
      )
  FileActions
    Defragment(Fast)
    FastFill()
    AddGap(RoundUp(ZoneEnd,VolumeFree * 0.01))
  FileEnd

  /* Zone 6: spacehog files (less important files that take up a lot of space). */
  FileSelect
    all
and
Not (
DirectoryPath("C:\delen\ExcellsFun") or DirectoryPath("C:\delen\Backups van TOPPY-PC\DOWN") or Size(1000000000,0)
      )
  FileActions
    Defragment(Fast)
    FastFill()
  FileEnd

 /* Zone 7: Move all files in delen-ExcellsFun and files over 1GB to the end of the partition */
FileSelect
DirectoryPath("C:\delen\ExcellsFun") or DirectoryPath("C:\delen\Backups van TOPPY-PC\DOWN") or Size(1000000000,0)
FileActions
  MoveToEndOfDisk()
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

/* Write the footer to the logfile. See the "Settings.MyD" file for the
   definition of the "LogFooter" string. */
AppendLogfile("MyDefrag.log","LogFooter")
« Last Edit: March 27, 2012, 08:33:04 pm by Bart Welson » Logged
Darlis
JkDefrag Hero
*****
Posts: 1707


View Profile WWW
« Reply #1 on: March 28, 2012, 06:27:34 am »

1) what am I doing wrong here. and...
The script is processed from the beginning to the end. If a file is not selected in a zone it will be placed behind it. If your files are selected last they will be moved away from each other zone to make room for the files that belong into this zone.

2) is it allowed, and should this work, by placing the MoveToEndOfDisk() part at the very beginning of my script, so that the next zones will no longer have to move them over and over ?
It is allowed and should work as expected.
Logged

Need help creating a script? Try MyDefrag Script Creator.
Bart Welson
JkDefrag Senior
****
Posts: 25


View Profile
« Reply #2 on: March 28, 2012, 11:17:06 am »

Quote
1) what am I doing wrong here. and...
The script is processed from the beginning to the end. If a file is not selected in a zone it will be placed behind it. If your files are selected last they will be moved away from each other zone to make room for the files that belong into this zone.

Quote
2) is it allowed, and should this work, by placing the MoveToEndOfDisk() part at the very beginning of my script, so that the next zones will no longer have to move them over and over ?
It is allowed and should work as expected.
Thanks a lot for the help Darlis,

If it is allowed to place the MoveToEndOfDisk() part first, with which action or rule can i then make the script aware to go right to the position where in the script above, the normal zone 1 starts ?

I don't quite understand if i start with a zone that points to the very end of the disk, how i can make the script jump right back to the "start" of the disk in the next zone, where it has to start with the "default" part of the script ?

Care to guide me toward the correct action for that, please ?

EDIT: i now see i posted this in the JKDefrag forum instead of the Mydefrag one. Lips sealed
« Last Edit: March 28, 2012, 04:46:01 pm by Bart Welson » Logged
Darlis
JkDefrag Hero
*****
Posts: 1707


View Profile WWW
« Reply #3 on: March 28, 2012, 07:11:27 pm »

If MoveToEndOfDisk() is used in a FileAction the zone pointer is not altered i.e if you use it as first zone, the second zone will still start at the beginning of the volume.
Logged

Need help creating a script? Try MyDefrag Script Creator.
Bart Welson
JkDefrag Senior
****
Posts: 25


View Profile
« Reply #4 on: March 28, 2012, 07:25:22 pm »

It's working wonderfully well,

Thank you so much for the great explaining instructions Darlis !  Smiley
Logged
Darlis
JkDefrag Hero
*****
Posts: 1707


View Profile WWW
« Reply #5 on: March 28, 2012, 07:37:18 pm »

You're welcome.  Smiley
Logged

Need help creating a script? Try MyDefrag Script Creator.
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!