Intro Download and install Frequently Asked Questions Tips and tricks

Homepage







© J.C. Kessels 2009
MyDefrag Forum
May 21, 2013, 08:48:28 am *
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: Scripting improvement/simplification  (Read 6654 times)
TeDDy
JkDefrag Hero
*****
Posts: 158


View Profile WWW
« on: February 25, 2009, 10:02:47 pm »

First of all: well done JEROEN !!!
The 4.0 version seem really move more files than previous.
Not important but the full paths showed at top and bottom of the window uses the 8.3 dos representation and is confuse. Better long names.
Very nice the interogation cross on diskmap and the zoom feature!
By the way, this is the first time to have a defrag program who needs more than
512RAM+768swap to defrag the 10Gib c: drive in SlowOptimize mode and crashes!

As I can see, the command line remains backward compatible and is extended by the power of the scripts.
Now, you can make MyDefrag to read myd files, in the root of drives with specific directives if started
WITHOUT PARAMETERS(2 click on the exe).
This way drives are defragged the same way when moved on other computers and driveletters CHANGES !
Still no improvement for the empty_end_of_drive and fill it with files/folders (by extension and wildcard)
IN THE FIRST PASS (to make place at the begining).
The idea is to create specific command to first move files at the end after calculate space needed for them and make this space available.
Then move those files at end(defrag,fill,sort...)
This can be applied by special threatment and specific name of operation
(ex. select *.mp3,*.avi,*.iso,*.cab,*\Driver Cache\*,*\inf\*,size>50Mib) MakeSpace,MoveEnd.
Also, multiple selections to be alowed in same statement for each action.
As tribute to old version, MyDefrag take zones in the input order(1,2,3,,)
not by importance
(archives-end, spacehogs before big freespace and then sort files to the begining as usual).
Also, in my opinion reclaim MFT space should be done BY DEFAULT on each ntfs drive.
SelectDrive:All/m(mounted y/n)/r(removable y/n)/c:,d:(for individual) in one line!

Ex:
SelectDrive:c:,e:,ry(rn),my/mn
t1=x days
t2=y days
space_at_end_of_modified_files=0 or percent, size.. etc (future mods are done at end of file=nofrag)
reclaimMFT=y/n
deletezerobytefiles=y/n
emptyreciclebin=y/n
moveendfiles:*.rar,*.avi,*.cab,>200MiB   | calculate space needed at end,
moveendfoders:*\Driver Cache\*,*\inf\*   | clear* and "fill" in first action
spacehogfiles..(masks,size)..   |
spacehogfolders..(mask)..   | calculate space, clear* and "fill" second action

*if WRONG files are present, to be moved to the rigth zone by optimisation rules
"fill" by selectable symbolic methods(bulk,defrag,name,size,type....)
This creates, from end of drive to the begining, 3 zones:
   -archive(noModif, noChange, lowSpeed files)
   -free space
   -spacehogs(temp files/folders, cache, very modif. files.....etc)
Now a lot of space is available after moved "junk" and if
files moved in first 2 steps are moved properly (as in rules who follow), most part is done
and predefined/custom optimisations can be done

Number of zones:

*Zone_1 movefirst (begin of drive, most acessed <t1, not modified)
*Zone_2   freespace=0 or percent, size.. etc
*Zone_3 ( t1 < acessed and modified < t2 )
*Zone_4   freespace=0 or percent, size.. etc
*Zone_5   (low acess, modified frequently)
.
.
.
.
For each zone 1,3,5...(freespace excluded)
Select1: -mask
   -accesstme<xx days
   -
   -
   SelectEnd
Action1: -defrag/sortAsc/Desc....
other rules/options.......

Select2
Action2
.......
Selectn
Actionn



Resuming, Mydefrag move more files, better diskmap, has same presets/commandline, 8.3 filename in info tags
and can be more customisable if you are VERY SMART and PATIENT.
Scrips for start are TOO COMPLEX, small percent of users will take advantage.
Ini format is more easy to use for milions of users, is used in big and complex
programs with thousands of settings with variants, can be readed by default,
can be generated if missing with commented defaults.

I can be more specific if I miss some.
Logged
jeroen
Administrator
JkDefrag Hero
*****
Posts: 7155



View Profile WWW
« Reply #1 on: February 26, 2009, 08:12:59 pm »

Not important but the full paths showed at top and bottom of the window uses the 8.3 dos representation and is confuse. Better long names.
The program shows the first name that happens to be in the MFT/FAT. Sometimes that is the long name, sometimes the short name. On NTFS it is usually the long filename, but I notice now that on FAT it is usually the short filename. I will see what I can do.

Quote
Now, you can make MyDefrag to read myd files, in the root of drives with specific directives if started WITHOUT PARAMETERS(2 click on the exe).
Thanks for sharing your idea, I will put it on the wishlist.

Quote
Still no improvement for the empty_end_of_drive and fill it with files/folders (by extension and wildcard) IN THE FIRST PASS (to make place at the begining).
MyDefrag automatically moves files out of the way when necessary. This way it does not need a minimum amount of disk space at the end of the disk. You can implement your idea in a script by placing 2 "VolumeSelect" in a single script. The first would move the wanted files to the end, the second would do whatever you want with them.

Quote
Also, multiple selections to be alowed in same statement for each action.
See the AND and OR filebooleans.

Quote
Also, in my opinion reclaim MFT space should be done BY DEFAULT on each ntfs drive.
The FastOptimize, FastUpdate, and SlowOptimize scripts do that.

Quote
Scrips for start are TOO COMPLEX
Well, I've tried to make it as simple as possible. I respectfully think your INI proposal is even more complex and would make bigger scripts, and is less flexible.
Logged
TeDDy
JkDefrag Hero
*****
Posts: 158


View Profile WWW
« Reply #2 on: February 27, 2009, 07:34:16 pm »

_______________________________
SelectDrive:c:,e:,ry(rn),my/mn
t1=x days
t2=y days
space_at_end_of_modified_files=0 or percent, size.. etc (future mods are done at end of file=nofrag)
reclaimMFT=y/n
respect_Layout.ini=y/n
deletezerobytefiles=y/n
emptyreciclebin=y/n
moveendfiles=*.rar,*.avi,*.cab,>200MiB   | calculate space needed at end,
moveendfoders=*\Driver Cache\*,*\inf\*   | clear* and "fill" in first action
spacehogfiles..(masks,size)..   |
spacehogfolders..(mask)..   | calculate space, clear* and "fill" second action
__________________
Select1: -mask
   -accesstme<xx days
   -
   -
   SelectEnd
Action1: -defrag/sortAsc/Desc....
other rules/options.......

Select2
Action2
.......
Selectn
Actionn
_____________________________That's it.

I think it's more simple.
Common users fill y/n, file/folder mask in the predefined/fixed first part and select ALL/acesstime and freespace% between zones in the second part.
Maniacs  (like me) can do more selects in the variable second part, but the less important stuff is predefinited and placed at the VERY END of drive and JUST BEFORE the big free space.
The rest is optimisation with ALL/Layout.ini/acesstime or multiple selections.
Also, autodetect driveletter from wich the myd is loaded(select %currentdrive%)
Reclaim MFT by default(no need for scripting)
Quote
MyDefrag automatically moves files out of the way when necessary. This way it does not need a minimum amount of disk space at the end of the disk. You can implement your idea in a script by placing 2 "VolumeSelect" in a single script. The first would move the wanted files to the end, the second would do whatever you want with them.
Not move "out of the way" to make place and after optimised but to place them in the calculated position.
Still can' get the script to work with 2 "VolumeSelect", sorry for the PM, but....
Logged
jeroen
Administrator
JkDefrag Hero
*****
Posts: 7155



View Profile WWW
« Reply #3 on: February 27, 2009, 09:48:21 pm »

I think it's more simple.
I appreciate all the time and thought you have put into this, but it is a huge departure from the current MyDefrag scripts. I am sorry but am going to continue on the path I have set with the MyDefrag scripts.

Perhaps a suggestion: build a Windows program that shows choices such as you propose, and then generates a MyDefrag script. I'm sure lot's of people will appreciate such a program.
Logged
DIRTY_DEALER
JkDefrag Senior
****
Posts: 20


View Profile
« Reply #4 on: February 28, 2009, 02:48:32 am »

I'd love to see a windows program to configure mydefrag. my favorite for jkdefrag was JkDefragGUI 1.04, prehaps we can encourage the person who made this to upgrade for mydefrag 4.x ?

Logged
TeDDy
JkDefrag Hero
*****
Posts: 158


View Profile WWW
« Reply #5 on: February 28, 2009, 09:57:33 am »

As I understand, by 2 pass command line
1- running with -a6 = Move to end of disk , let it finish the job with INCLUDE files
2- restart and set TO EXCLUDE files in previous start and optimise
1+2=2 passes to do the job.
The script can't move files to the end FIRST because it understands the command AS FIRST ZONE?
So the program can do it by command line, not by script?
Then we need a special syntax in script to FIRSTLY Move to end of disk selected files?
Only Jeroen can do-it!

Personally I don't understand why people with hundred file types on drive, who wish to defragment their drive don't want to move at the end of drive the archives, music, movies, pictures, iso's, driver kit's, document archives, folders with less (un)used data and AFTER THAT optimise the drive to get the speed.
I think this is the goal of a modern defrag program: defrag files and move the most used to the fast drive zone and the files who don't need acess or speed to the very end(they never refragment again so why move them every defrag?). Starting always with zone1 will move "SLOW FILES" fragments somewhere to make place and then, if user is smart, move those to the end.
Why this viceversa?
I am still tryng to modify the 3.x sources to do the things this way. It's just an exercise on a dead project wich  can't move all the unlocked files, until, perhaps Jeroen will release a mod to the 3.x sources to move those files as 4.x does.

I still am a fan of the Norton SpeedDisk, wich under w9x/ME makes this perfect defragmentation.
If I have the time, I reboot with w98, defrag all the fat32 drives and my data is ordered, in few minutes(<1hour) on 6-7 zones by relevance, with interleave and all the stuff, even on the ACTIVE BOOT PARTITION.
Unfortunetly veeery few modern computers can suport w98/ME install.
If someone wish to see how operates this perfect defrag, play with Virtual machines, w98 and install Norton Utilities 2001(I can help you here with lited version).
Many programs defrag files on NT/2k/XP, many programs order files on drive.
NONE this day does the smart placement as SpeedDisk does.
That's why I write this, that's why I bother Jeroen. Real world needs a perfect defrag and Jeroen's is the most flexible.
I don't know exactly how, but I know what a perfect defrag must do(select files and place them in best order, defrag comes on the fly).

If someone want to get SEEK of defragmentation, I can help him with my knowledge.(ha ha)

« Last Edit: February 28, 2009, 10:48:00 am by teddy » Logged
jeroen
Administrator
JkDefrag Hero
*****
Posts: 7155



View Profile WWW
« Reply #6 on: February 28, 2009, 08:31:32 pm »

The script can't move files to the end FIRST because it understands the command AS FIRST ZONE?
MyDefrag scripts are based on the idea that you start placing files at the beginning of the disk, and then work your way to the end. The whole program is based on that. For example first the MFT, then the directories, then the files used when booting, then everything except spacehogs ("archives, music, movies, pictures, iso's, driver kit's, document archives, folders with less (un)used data"). What is left over are the spacehogs, and MyDefrag will move them automatically to behind all the rest. What you want to do may seem easier at first glance, and is in fact possible with MyDefrag, but is going against the grain and is more difficult.

Quote
So the program can do it by command line, not by script?
It is possible to put everything you want in a single script. If you have 2 commandlines, then basically what you are doing is executing two VolumeSelect structures. You can put both structures in a single script and MyDefrag will execute them happily, one after the other.
Logged
TeDDy
JkDefrag Hero
*****
Posts: 158


View Profile WWW
« Reply #7 on: March 01, 2009, 10:06:45 am »

I made an alteration to the Slow Optimize.

I want to select c,f,j drives if not removables
On this drives, in this order I want to get, from end to the begining of drive :
-zone 8 :mp3,avi,rar,zip,iso,cab and some folders(mask) with their contained files defragged/sorted
-zone 7 :90% of the free space
-zone 6 :temp folders, logs, reports, volatile files
-zone 1,3,5 : remaining files sorted by acess time(and layout.ini if apliable)
-zone 2,4 :5% free space

Can anyone help me to do this? Many peple can benefit from it!
Millions thanks in advance!
« Last Edit: March 01, 2009, 10:58:24 am by teddy » Logged
jonib
JkDefrag Hero
*****
Posts: 810


View Profile
« Reply #8 on: March 01, 2009, 12:05:03 pm »

Can anyone help me to do this? Many peple can benefit from it!
Millions thanks in advance!
Hi teddy, I made a sample script for you here.

jonib
Logged

TeDDy
JkDefrag Hero
*****
Posts: 158


View Profile WWW
« Reply #9 on: March 01, 2009, 05:04:02 pm »

Thank you Jonib.
I am testing it right now.
Unfortunetly it crash tryng to select contents of folder. I'll try to disable folder delections.
Looking at your sample I understand my mistakes.
Scripting or not, files to be movet at end MUST be writed TWICE(first to INCLUDE second to EXCLUDE)
They should rest excluded after processing by selecting ONCE!

I still this is a script language miss.
Selecting files/folders must be persistent. Select *.mp3.... move there excludes them from future selections.
Specific syntax must override linear placement from the begin of drive, alowing placement to the end as frist action and then exclude them.
Now we exclude 6 masks, defrag remaining(vacated files are spread around).
Zone n-2, select 2 masks(exclude others)(vacated files are spread around), guess to place before free space.
Zone n, select 4 masks(exclude others), place at end

If Jeroen wish to make this possible, by script language/keyword, selected files go directly to the vacated end of drive and AFTER THAT remaining files are optimised by excluding already processed.
Adding to FileActions new keyword to instruct mydefrag to firstly move at end and then substract this selection from remaining list?

Thank you
You are more advanced.
Perhaps you can refine the script to select ONCE?
For now, this will be the ONLY script I will use. Good bless you!
« Last Edit: March 01, 2009, 05:35:39 pm by teddy » Logged
TeDDy
JkDefrag Hero
*****
Posts: 158


View Profile WWW
« Reply #10 on: March 01, 2009, 05:56:00 pm »

If mydefrag can consider 2 type of big zones:
  a-high performance
  b-low performance
and when started understands what files/folders to place in zone b and in wich order, when optimizing files in zone a, files who need to go in zone b are not vacated somewhere but at their place in zone b if the place is EMPTY. If not(other file is taking space) vacate this file to it's right position. I know it can be long and recursive but less write to disk is preferred. To avoid the recursive actions, parts of fragments can be moved to their calculated position if the position is free. This will increase the cpu load but will make less writes to disk.
Perhaps I am just a writing maniac?
Logged
jonib
JkDefrag Hero
*****
Posts: 810


View Profile
« Reply #11 on: March 01, 2009, 06:42:28 pm »

Scripting or not, files to be movet at end MUST be writed TWICE(first to INCLUDE second to EXCLUDE)
They should rest excluded after processing by selecting ONCE!
Actually the script needs to exclude any files that are to be placed after the "ALL" option and then included in the zone they belong to.
Quote
Perhaps you can refine the script to select ONCE?
As long as you want files at the end of the volume I don't believe it's possible right now unless the MyDefrag script language is expanded, but thats out of my control.

jonib
Logged

jeroen
Administrator
JkDefrag Hero
*****
Posts: 7155



View Profile WWW
« Reply #12 on: March 01, 2009, 11:40:52 pm »

It is possible to put everything you want in a single script. If you have 2 commandlines, then basically what you are doing is executing two VolumeSelect structures. You can put both structures in a single script and MyDefrag will execute them happily, one after the other.
Correction. It is possible to put multiple VolumeSelect structures in a single script, but volumes are processed only once. If a volume has been processed by a VolumeSelect, then it will not be processed again by a subsequent VolumeSelect. So, it is NOT possible to combine 2 scripts into 1 script, if the scripts need to process the same volume.
Logged
TeDDy
JkDefrag Hero
*****
Posts: 158


View Profile WWW
« Reply #13 on: March 02, 2009, 12:49:50 pm »

When process a volume, the analize selects all files and folders.
If I put Fileselect ALL and Not(.....archives...) then from initial selection, archives are DELETED not marked as delayed for future selections.
If after first selection I put Fileselect ALL , the selection should contain JUST the exclusions from the first pass. Right?
Using this script, files should be sorted by acess and archives should go to the end?
#
Name("h:") # Or Name("f:") Or Name("j:")
VolumeActions
  FileSelect
    All and Not(  FileName("*.log")
                 Or FileName("*.mp3")
                 Or FileName("*.avi")
                 Or FileName("*.rar")
                 Or FileName("*.zip")
                 Or FileName("*.iso")
                 Or FileName("*.cab")
                 Or DirectoryName("Multimedia"))
  FileActions
    SortByLastAccess(Ascending)
  FileEnd
#
  FileSelect
    All
    FileActions
      SortByName(Ascending)
  FileEnd
VolumeEnd
------------------
The program can move files to the end but the script has no keyword to do that and scripting langiage do not allow dedicated selection. Ex: select...beginOfDrive, EndOfDrive, NearEndOfDrive
This way, if at the begining of script
 -fileselect *.mp3 NearEndOfDrive byname
 -fileselect *.iso EndOfDrive byname
 -fileselect ALL beginOfDrive by acess
will make the first 2 selections persistent, separate them from selection 3, calculate their size and position on drive and processing order don't matter. Begin of drive is optimized and vacated files from sel. 1&2 can go directly to their zones, avoiding double or triple movement.
Zones must have somehow labels so files are selected once and processed once, no matter the order of selection or zones declaration. After selection, processing order of zones can be as it is now, z1,z2...zn because files are already placed in the zoned array in memory.
I want to say to begin file movement AFTER all files are sorted by zones in memory, no matter the order in wich files are selected as they are selected to go in DEDICATED zones on drive. Make the calculations BEFORE start moving files.
Logged
jeroen
Administrator
JkDefrag Hero
*****
Posts: 7155



View Profile WWW
« Reply #14 on: March 02, 2009, 02:04:30 pm »

If I put Fileselect ALL and Not(.....archives...) then from initial selection, archives are DELETED not marked as delayed for future selections.
MyDefrag does not delete ANYTHING on your disk.

Quote
Using this script, files should be sorted by acess and archives should go to the end?
Yes. The first FileSelect in your example processes all files except for a selection of archives. The second FileSelect again selects all files, but only the archives have not been processed yet so those are the only files selected.

Quote
The program can move files to the end but the script has no keyword to do that
Yes it does, see the SetBeginOfZone function.

Quote
Make the calculations BEFORE start moving files.
Thanks for sharing your idea, I appreciate it.
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!