Intro Download and install Frequently Asked Questions Tips and tricks

Homepage







© J.C. Kessels 2009
MyDefrag Forum
May 22, 2013, 02:29:52 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: MakeGap under FileActions?  (Read 1155 times)
rdsu
JkDefrag Hero
*****
Posts: 97


View Profile
« on: April 20, 2010, 10:44:21 am »

Hi,

I would like to know if their is a way to use the MakeGap under FileActions?

I need this because I would like to use the ZoneSize to determine where to put a Zone...

Doesn't make more sense to have the MakeGap in FileActions?

Thanks
Logged
BloodySword
JkDefrag Hero
*****
Posts: 1113



View Profile
« Reply #1 on: April 20, 2010, 10:53:24 am »

There's AddGap for this: http://www.mydefrag.com/FileActions-AddGap.html  Smiley
Logged

Greetings from Germany!
rdsu
JkDefrag Hero
*****
Posts: 97


View Profile
« Reply #2 on: April 20, 2010, 11:12:05 am »

Thanks.

Didn't think of it to determine the beginning of a zone... Smiley
Logged
rdsu
JkDefrag Hero
*****
Posts: 97


View Profile
« Reply #3 on: April 20, 2010, 12:41:45 pm »

AddGap doesn't resolve my problem, because I want to decide where to start putting the SpaceHog.

And then try to put the MFT and Directories in the middle of the regular data.

Code:
# My System Daily
#
# Requirement: MyDefrag 4.x.

Title('My System Daily New')
Description("System Daily description")   // See the "Settings.MyD" file.



/* Automatically exit when the script has finished. This script is designed to
   be run via the task scheduler, so it must exit automatically. */
WhenFinished(exit)
WindowSize(minimized)

/* 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

  /* My Disk Display Color */
  !Include Includes\SystemDiskDisplayColor.MyD!

  /* Write the "before" statistics to the logfile. See the "Settings.MyD" file
     for the definition of the "LogBefore" string. */
  AppendLogfile("MyDefrag.log","LogBefore")
 
  /* Zone 1: SpaceHogs files (less important files that take up a lot of space). */
  FileSelect
    not
(/* Without SpaceHogs */
    !Include Includes\SpaceHogs.MyD!)
  FileActions
AddGap(VolumeUsed - ZoneSize + (VolumeUsed * 0.1))
    Defragment(Fast)
    FastFill()
  FileEnd 
 
  /* Place files at middle of regular data on the disk. */
  MakeGap(RoundUp((VolumeUsed - ZoneSize) * 0.5,VolumeSize * 0.01), DoNotVacate)

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

  /* Zone 3: Directories. */
  FileSelect
    Directory(yes)
  FileActions
    SortByName(Ascending)
  FileEnd

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

  /* Zone 4: files used when booting, and a gap. */
  FileSelect
    ImportListFromBootOptimize()
  FileActions
    Defragment(Fast)
    FastFill()
    AddGap(RoundUp(ZoneEnd,VolumeFree * 0.01))
  FileEnd

  /* Zone 5: files used by the most used programs, and a gap. */
  FileSelect
    ImportListFromProgramHints("*.pf")
  FileActions
    Defragment(Fast)
    FastFill()
    AddGap(RoundUp(ZoneEnd,VolumeFree * 0.01))
  FileEnd

  /* Zone 6: regular files, and a gap. */
  FileSelect
    all
  FileActions
    Defragment(Fast)
    FastFill()
    AddGap(RoundUp(ZoneEnd,VolumeFree * 0.1))
  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")
Logged
Darlis
JkDefrag Hero
*****
Posts: 1707


View Profile WWW
« Reply #4 on: April 20, 2010, 02:51:56 pm »

AddGap(VolumeUsed - ZoneSize + (VolumeUsed * 0.1))
You're missing a ", DoNotVacate" there.
I don't know if the position of the current zone can be altered at this point (I doubt it).

Nevertheless, your calculation seems to put the spacehogs right there where they would end up in the standard scripts. Also, no files will be moved up because FastFill() only moves down. (and not using DoNotVacate will move every file up, not just the selected.)

MakeGap and AddGap are equal, except for their location in the script.
Logged

Need help creating a script? Try MyDefrag Script Creator.
rdsu
JkDefrag Hero
*****
Posts: 97


View Profile
« Reply #5 on: April 20, 2010, 03:15:53 pm »

Nevertheless, your calculation seems to put the spacehogs right there where they would end up in the standard scripts. Also, no files will be moved up because FastFill() only moves down. (and not using DoNotVacate will move every file up, not just the selected.)
I know that, but I want to process the SpaceHog first, to avoid to put them on the next instructions...
This is a simple script, but I have others...

MakeGap and AddGap are equal, except for their location in the script.
The AddGap will not remove the all the files on that Gap?
It seems that the answer is yes, because we use it for that purpose at the end of some FileActions...
So they aren't equal, because MakeGap just start to move the files for that position...

I'm I wrong?
Logged
BloodySword
JkDefrag Hero
*****
Posts: 1113



View Profile
« Reply #6 on: April 20, 2010, 03:17:52 pm »

You can force the files into the zone by using SortByName or MoveDownFill, but it will take a long time because every file will be moved. Jeroen is working on a FastFill action wich will move files in all directions to the corresponding zone.
Logged

Greetings from Germany!
rdsu
JkDefrag Hero
*****
Posts: 97


View Profile
« Reply #7 on: April 20, 2010, 03:21:55 pm »

The way I want to make the script I can know where to put the MFT and Directories on the best position, that is in the middle of most used data...

It seems that know I can only make this work my move the SpaceHog at the end of Disk...
Logged
BloodySword
JkDefrag Hero
*****
Posts: 1113



View Profile
« Reply #8 on: April 20, 2010, 03:31:51 pm »

It should be possible to do it like the standard script. First it will put the MFT and Dirs into the data by using MakeGap between the zones, then it uses MakeGap(0) to move the pointer to the very beginning of the drive.

You could try to calculate a value wich will set the pointer a bit away from the last zone, after it has moved the spacehogs to the end of the last zone.

Wich kind of spacehogs are your files that you want to move to the last zone?
Logged

Greetings from Germany!
rdsu
JkDefrag Hero
*****
Posts: 97


View Profile
« Reply #9 on: April 20, 2010, 03:44:19 pm »

What I want for system partition?

1. MFT and Directories in the middle of most used data (i.e.: all data except SpaceHogs)
2. layout.ini
3. Windows
4. "Program Files" or ProgramData
5. "Documents and Settings" or Users
6. rest of regular data
7. SpaceHogs

In my current monthly system script I want to avoid to exclude the spacehogs on every section, and I put the MFT and Directories on the right position.

Code:
# My System Monthly
#
# Requirement: MyDefrag 4.x.

Title('My System Monthly')
Description("System Monthly description")      // See the "Settings.MyD" file.



/* Automatically exit when the script has finished. This script is designed to
   be run via the task scheduler, so it must exit automatically. */
WhenFinished(exit)
WindowSize(minimized)

/* 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

  /* My Disk Display Color */
  !Include Includes\SystemDiskDisplayColor.MyD!

  /* 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 20% into the data on the disk. */
  MakeGap(RoundUp(VolumeUsed * 0.2,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()
  FileActions
    SortByImportSequence(Ascending)
    AddGap(RoundUp(ZoneEnd,VolumeFree * 0.01))
  FileEnd

  /* Zone 4: files used by the most used programs, and a gap. */
  FileSelect
    ImportListFromProgramHints("*.pf")
  FileActions
    SortByImportSequence(Ascending)
    AddGap(RoundUp(ZoneEnd,VolumeFree * 0.01))
  FileEnd
 
  /* Zone 5: 'Windows' folder. */
  FileSelect
    DirectoryPath("?:\Windows")
    and
/* Without SpaceHogs */
    !Include Includes\SpaceHogs.MyD!
  FileActions
    SortByName(Ascending)
  FileEnd
 
  /* Zone 6: 'Program Files' and 'ProgramData' folders. */
  FileSelect
    (DirectoryPath("?:\Program Files")
or DirectoryPath("?:\ProgramData"))
    and
/* Without SpaceHogs */
    !Include Includes\SpaceHogs.MyD!
  FileActions
    SortByName(Ascending)
  FileEnd
 
  /* Zone 7: 'Documents and Settings' and 'Users' folders. */
  FileSelect
    (DirectoryPath("?:\Documents and Settings")
or DirectoryPath("?:\Users"))
    and
/* Without SpaceHogs */
    !Include Includes\SpaceHogs.MyD!
  FileActions
    SortByName(Ascending)
AddGap(RoundUp(ZoneEnd,VolumeFree * 0.01))
  FileEnd

  /* Zone 8: regular files, and a gap. */
  FileSelect
    /* Without SpaceHogs */
    !Include Includes\SpaceHogs.MyD!
  FileActions
    SortByName(Ascending)
    AddGap(RoundUp(ZoneEnd,VolumeFree * 0.1))
  FileEnd

  /* Zone 9: SpaceHogs files (less important files that take up a lot of space). */
  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

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

Code:
# SpaceHogs

not(
  // Default
  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("*.zip")
 
  // Additional
  or DirectoryName("AHCache")
  or DirectoryName("cachedinstallations")
  or DirectoryName("Config.Msi")
  or DirectoryName("Downloaded Program Files")
  or DirectoryName("Driver Cache")
  or DirectoryName("DriverStore")
  or DirectoryName("MSOCache")
  or DirectoryName("SysMsiCache")
  or FileName("*.00?")
  or FileName("*.01?")
  or FileName("*.3gp")
  or FileName("*.aac")
  or FileName("*.ace")
  or FileName("*.aif")
  or FileName("*.asf")
  or FileName("*.bkp")
  or FileName("*.dmp")
  or FileName("*.flv")
  or FileName("*.m3u")
  or FileName("*.mkv")
  or FileName("*.mov")
  or FileName("*.mp4")
  or FileName("*.mpa")
  or FileName("*.mpeg")
  or FileName("*.mpg")
  or FileName("*.ogg")
  or FileName("*.pls")
  or FileName("*.qt")
  or FileName("*.ra")
  or FileName("*.ram")
  or FileName("*.rm")
  or FileName("*.swf")
  or FileName("*.torrent")
  or FileName("*.vcd")
  or FileName("*.wma")
  or FileName("*.zipx")
  )
« Last Edit: April 20, 2010, 03:49:38 pm by rdsu » Logged
Darlis
JkDefrag Hero
*****
Posts: 1707


View Profile WWW
« Reply #10 on: April 20, 2010, 04:10:37 pm »

MakeGap and AddGap are equal, except for their location in the script.
The AddGap will not remove the all the files on that Gap?
It seems that the answer is yes, because we use it for that purpose at the end of some FileActions...
So they aren't equal, because MakeGap just start to move the files for that position...
I can't really make out what you're trying to say, but I'll try to answer:
If there is no DoNotVacate present in Add/MakeGap, the gap from the current position to the position specified in the statement is cleared (I guess this works only if the new location is higher than the current one, so Add/MakeGap(0) does never vacate).
AddGap is usually used for enlarging zones, so it has no DoNotVacate, because you (mostly) want an empty gap after a zone.
MakeGap is usually used for jumps, so you have to add DoNotVacate, so that it won't vacate files.
Logged

Need help creating a script? Try MyDefrag Script Creator.
rdsu
JkDefrag Hero
*****
Posts: 97


View Profile
« Reply #11 on: April 20, 2010, 04:23:21 pm »

MakeGap and AddGap are equal, except for their location in the script.
The AddGap will not remove the all the files on that Gap?
It seems that the answer is yes, because we use it for that purpose at the end of some FileActions...
So they aren't equal, because MakeGap just start to move the files for that position...
I can't really make out what you're trying to say, but I'll try to answer:
If there is no DoNotVacate present in Add/MakeGap, the gap from the current position to the position specified in the statement is cleared (I guess this works only if the new location is higher than the current one, so Add/MakeGap(0) does never vacate).
AddGap is usually used for enlarging zones, so it has no DoNotVacate, because you (mostly) want an empty gap after a zone.
MakeGap is usually used for jumps, so you have to add DoNotVacate, so that it won't vacate files.

Thanks for try to help Smiley

I tried:
/* Zone 1: SpaceHogs files (less important files that take up a lot of space). */
  FileSelect
    not
   (/* Without SpaceHogs */
    !Include Includes\SpaceHogs.MyD!)
  FileActions
   AddGap(VolumeUsed - ZoneSize + (VolumeUsed * 0.1), DoNotVacate)
    Defragment(Fast)
    FastFill()
  FileEnd

But it removed the layout.ini files from the beginning and started to put the SpaceHogs there...
Logged
Darlis
JkDefrag Hero
*****
Posts: 1707


View Profile WWW
« Reply #12 on: April 20, 2010, 04:44:36 pm »

I see. Then the AddGap does *not* reposition the current zone, just like I guessed.

If you don't want to exclude the files every time, then you should wait for the next version of MyDefrag, because it'll have a function to move files up fast. Then put the spacehogs to a fixed position with MakeGap(). You'll have to use a larger gap for this, but it'll be better than to move the spacehogs to the far end of the drive.

I'm working a lot with fixed positions, so the gaps are sometimes larger than they should be, but therefore there is less zone shifting.

Another solution would be to use to scripts: Select all files except spacehogs and leave FileActions empty. The normal files won't be touched again and you can then move the spacehogs after all these files.
Logged

Need help creating a script? Try MyDefrag Script Creator.
rdsu
JkDefrag Hero
*****
Posts: 97


View Profile
« Reply #13 on: April 20, 2010, 05:03:39 pm »

Ok, so I will wait for next version... Smiley

Thanks
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!