Intro Download and install Frequently Asked Questions Tips and tricks

Homepage







© J.C. Kessels 2009
MyDefrag Forum
May 23, 2013, 06:42:50 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: Exclude NTFS mountpoints in every script  (Read 1241 times)
jack_steel
Newbie
*
Posts: 4


View Profile
« on: October 24, 2009, 12:59:53 pm »

I have some NTFS mountpoints (discs mounted as NTFS folder) I want to exclude in every script, so I tried to add the following code to the settings.myd file first, but with no success.

Code:
ExcludeFiles(
DirectoryName('E:\ARCHIV_FOTOS') and
DirectoryName('E:\ARCHIV_DATA')
)

Then I added same code to the OptimizeDaily script after VolumeSelect. I get an error again. What I'm doing wrong?
Logged
jack_steel
Newbie
*
Posts: 4


View Profile
« Reply #1 on: October 24, 2009, 01:17:28 pm »

I tried it with the ExcludeVolumes command, too.

Code:
ExcludeVolumes(
Name("E:\ARCHIV_FOTOS") and
Name("E:\ARCHIV_DATA")
)

I put the command outside the VolumeSelect command, I get no error now but the volumes are still processed :-( It tried with the mountpoint name, same result.

Code:
ExcludeVolumes(
Name("E:\ARCHIV_FOTOS\") and
Name("E:\ARCHIV_DATA\") and
Name("\\?\Volume{536d1a8a-bc31-11de-8353-806e6f6e6963}\") and
Name("\\?\Volume{536d1a89-bc31-11de-8353-806e6f6e6963}\")
)

How to exclude these volumes?
« Last Edit: October 24, 2009, 01:34:53 pm by jack_steel » Logged
Darlis
JkDefrag Hero
*****
Posts: 1707


View Profile WWW
« Reply #2 on: October 24, 2009, 03:13:32 pm »

To exclude files use
"DirectoryPath("E:\ARCHIV_FOTOS")" or
"DirectoryName("ARCHIV_FOTOS")"

See the manpage for the Name VolumeBoolean on how to select Volumes.

You also have to connect the two folders/disks with "or", not "and", since you want both to get selected.
Logged

Need help creating a script? Try MyDefrag Script Creator.
jack_steel
Newbie
*
Posts: 4


View Profile
« Reply #3 on: October 24, 2009, 04:11:45 pm »

I mounted 2 volumes as a NTFS mountpoint, one is E:\ARCHIV_FOTOS and one is E:\ARCHIV_DATA. I added the following block in the OptimizeDaily Script before the VolumeSelect block.

Code:
ExcludeFiles(
DirectoryName("E:\ARCHIV_FOTOS\") and
DirectoryName("E:\ARCHIV_DATA\")
)

ExcludeVolumes(
Name("E:\ARCHIV_FOTOS\") and
Name("E:\ARCHIV_DATA\") and
Name("\\?\Volume{536d1a8a-bc31-11de-8353-806e6f6e6963}\") and
Name("\\?\Volume{536d1a89-bc31-11de-8353-806e6f6e6963}\")
)


So this is the whole script.
Code:
# MyDefrag v4.0 default script: Optimize Daily
#
# This script is part of the standard MyDefrag distribution.

Title('Optimize Daily')
Description("Optimize Daily description")   // See the Setup.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)

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

ExcludeFiles(
DirectoryName("E:\ARCHIV_FOTOS\") and
DirectoryName("E:\ARCHIV_DATA\")
)

ExcludeVolumes(
Name("E:\ARCHIV_FOTOS\") and
Name("E:\ARCHIV_DATA\") and
Name("\\?\Volume{536d1a8a-bc31-11de-8353-806e6f6e6963}\") and
Name("\\?\Volume{536d1a89-bc31-11de-8353-806e6f6e6963}\")
)

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

  /* 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. */
  FileSelect
    SelectNtfsSystemFiles(yes)
  FileActions
    PlaceNtfsSystemFiles(Ascending)
    AddGap(UntilPercentageOfVolumeMultiple(0.01))
  FileEnd

  /* Zone 2: directories and a gap. */
  FileSelect
    Directory(yes)
  FileActions
    Defragment(Fast)
    FastFill()
    AddGap(UntilPercentageOfVolumeMultiple(1))
  FileEnd

  /* Zone 3: files used when booting, and a gap. */
  FileSelect
    ImportListFromBootOptimize()
  FileActions
    Defragment(Fast)
    FastFill()
    AddGap(UntilPercentageOfVolumeMultiple(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("*.zip")
      )
  FileActions
    Defragment(Fast)
    FastFill()
    AddGap(UntilPercentageOfVolumeMultiple(1))
  FileEnd

  /* Zone 5: spacehog 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

When I start it, both excluded volumes are processed even though they are excluded 2 times with ExcludeFiles and ExcludeVolumes. Anyone can explain it?
« Last Edit: October 24, 2009, 04:28:03 pm by jack_steel » Logged
peters40
JkDefrag Hero
*****
Posts: 61


View Profile
« Reply #4 on: October 24, 2009, 04:15:43 pm »

Use "or" not "and" as Darlis has said
peter
Logged
Darlis
JkDefrag Hero
*****
Posts: 1707


View Profile WWW
« Reply #5 on: October 24, 2009, 04:17:40 pm »

Please read my previous post again carefully. It should be like this:
Code:
ExcludeFiles(
DirectoryPath("E:\ARCHIV_FOTOS") or
DirectoryPath("E:\ARCHIV_DATA")
)

ExcludeVolumes(
Name("\\?\Volume{536d1a8a-bc31-11de-8353-806e6f6e6963}\") or
Name("\\?\Volume{536d1a89-bc31-11de-8353-806e6f6e6963}\")
)
Logged

Need help creating a script? Try MyDefrag Script Creator.
jack_steel
Newbie
*
Posts: 4


View Profile
« Reply #6 on: October 24, 2009, 05:12:08 pm »

Shame on me...

Thank you guys.
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!