Intro Download and install Frequently Asked Questions Tips and tricks

Homepage







© J.C. Kessels 2009
MyDefrag Forum
May 23, 2013, 01:27:30 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: Modifying Supplied Scripts  (Read 990 times)
srm
JkDefrag Junior
**
Posts: 7


View Profile
« on: July 18, 2009, 01:35:13 pm »

I'm using the scheduler to run the supplied scripts "SlowOptimize.MyD" monthly and "FastUpdate.MyD" daily based on the recommendations I found in the forum and in help. I know the "FastUpdate.MyD" will close when done while the "SlowOptimize.MyD" will not. I also want the "SlowOptimize.MyD" to close when it is done running.

In looking at the script, is it as simple as adding "WhenFinished(exit)" below the "RunScript('Settings')" in the "SlowOptimize.MyD" file similar to the "FastUpdate.MyD" file?

====================================

On my computer I have my C: drive, a second hard drive (E:) and an external drive (Z: - connected via USB). The second and external drives are simply for backup and do not need to have MyDefrag run on them.  The only time they will be used is when I have data loss and need to recover data. For both the "SlowOptimize.MyD" monthly and "FastUpdate.MyD" scripts, they have the following volume commands. How would I turn off running MyDefrag against the E:(internal) and Z:(external) drives so it only runs on the C: drive?

VolumeSelect
  CommandlineVolumes()
  and Removable(no)
  and Writable(yes)
  and Mounted(yes)
VolumeActions

====================================

I'm assuming MyDefrag does not run against network drives unless it is turned on. If I'm incorrect, how would I turn those off as I do not want it to run against network drives?

====================================

I had one last question.  In looking at the MyDefrag.log file for "SlowOptimize.MyD", I see information for my E: and Z: drive, but not for my C drive. However, I had scheduled the "FastUpdate.MyD" to run at 3:00 AM this morning thinking the "SlowOptimize.MyD" would be done that I had started at 6:30 PM yesterday. I missed that it would run against the E: and Z : drives.

The "FastUpdate.MyD" ran while the "SlowOptimize.MyD" was still running and the log file names are the same for "FastUpdate.MyD" and "SlowOptimize.MyD". Would that be the reason for not seeing the C: data in the log file (see attached)?

I'm guessing I can change these in the script files to be different names and also to replace each log file. Each time the scripts run, the old log file data will be replaced. For example, would these be correct so each time the scripts run, the log files are replaced?

Change "FastUpdate.MyD" from  --  AppendLogfile("MyDefrag.log","  --  to WriteLogfile("FastUpdate.log","

Change "SlowOptimize.MyD" from  --  AppendLogfile("MyDefrag.log","  --  to WriteLogfile("SlowOptimze.log","

====================================

Thanks

Shawn

* MyDefrag.log (5.67 KB - downloaded 105 times.)
Logged
pthubbard
Newbie
*
Posts: 3


View Profile
« Reply #1 on: July 18, 2009, 01:53:38 pm »

In addition to these questions, could we have an example of how to exclude particular files or folders?
Logged
jeroen
Administrator
JkDefrag Hero
*****
Posts: 7155



View Profile WWW
« Reply #2 on: July 18, 2009, 01:58:32 pm »

In looking at the script, is it as simple as adding "WhenFinished(exit)" below the "RunScript('Settings')" in the "SlowOptimize.MyD" file similar to the "FastUpdate.MyD" file?
Yes, that's it.

Quote
How would I turn off running MyDefrag against the E:(internal) and Z:(external) drives so it only runs on the C: drive?
See the Name volumeboolean for an example.

Quote
I do not want it to run against network drives?
See the Remote volumeboolean.

Quote
Would that be the reason for not seeing the C: data in the log file (see attached)?
Yes, probably. See the OtherInstances setting to prevent 2 copies from running simultaneously.

Quote
For example, would these be correct so each time the scripts run, the log files are replaced?
Not quite. Changing the filename is fine, but the AppendLogfile() action will not replace. It appends. The standard scripts have a WriteLogfile() in the beginning of the script to clear the logfile and write some startup data, and an two AppendLogfile()'s further down to append data about every disk.
Logged
srm
JkDefrag Junior
**
Posts: 7


View Profile
« Reply #3 on: July 18, 2009, 03:25:42 pm »

Jeroen:

Thanks.

==================
WhenFinished(exit) - Understand
==================
Will this then look at the C drive only (not E and F) and not look at network drives?

VolumeSelect
  CommandlineVolumes()   ---   Is this needed?
  and Name("C:")
  and Removable(no)
VolumeActions

Can I just use this?

VolumeSelect
  Name("C:")
  and Removable(no)
VolumeActions
==================
OtherInstances - Understand
==================
Since the log is cleared each time MyDefrag is run, is the latest data always shown for both the "SlowOptimize.MyD" and the "FastUpdate.MyD", or when a script runs the log reflects only the latest data for that script?

If only the latest, I'm guessing that is when I would use the different log file names.
==================
Logged
majoMo
JkDefrag Hero
*****
Posts: 72



View Profile
« Reply #4 on: July 18, 2009, 04:28:08 pm »

BTW,

Using 'AnalyzeOnly.MyD' with 'WhenFinished(exit)'. If there are two disks (C: and D:) it doesn't exit because MyDefrag windows is paused after analyzing C:. How can I avoid pause status? [some if I use 'WhenFinished(exit)' and 'WindowSize(invisible)' - mydefrag.exe process is always in background].

If I use 'FastOptimize.MyD' some pause annoyance comes out [with 'WhenFinished(exit)' and 'WindowSize(invisible)']? Thanks.
Logged
jonib
JkDefrag Hero
*****
Posts: 810


View Profile
« Reply #5 on: July 18, 2009, 04:38:14 pm »

Can I just use this?

VolumeSelect
  Name("C:")
  and Removable(no)
VolumeActions
If you only want to defrag C: then you only need this:
Code:
VolumeSelect
  Name("C:")
VolumeActions

jonib
Logged

jonib
JkDefrag Hero
*****
Posts: 810


View Profile
« Reply #6 on: July 18, 2009, 04:40:39 pm »

Using 'AnalyzeOnly.MyD' with 'WhenFinished(exit)'. If there are two disks (C: and D:) it doesn't exit because MyDefrag windows is paused after analyzing C:. How can I avoid pause status? [some if I use 'WhenFinished(exit)' and 'WindowSize(invisible)' - mydefrag.exe process is always in background].

If I use 'FastOptimize.MyD' some pause annoyance comes out [with 'WhenFinished(exit)' and 'WindowSize(invisible)']? Thanks.
If you don't want MyDefrag to pause, comment or remove the Pause() command in the script.

jonib
Logged

majoMo
JkDefrag Hero
*****
Posts: 72



View Profile
« Reply #7 on: July 18, 2009, 06:02:13 pm »

Using 'AnalyzeOnly.MyD' with 'WhenFinished(exit)'. If there are two disks (C: and D:) it doesn't exit because MyDefrag windows is paused after analyzing C:. How can I avoid pause status? [some if I use 'WhenFinished(exit)' and 'WindowSize(invisible)' - mydefrag.exe process is always in background].

If I use 'FastOptimize.MyD' some pause annoyance comes out [with 'WhenFinished(exit)' and 'WindowSize(invisible)']? Thanks.
If you don't want MyDefrag to pause, comment or remove the Pause() command in the script.

jonib


Thanks for the suggestion. However the annoyance is: there aren't any Pause() command in the script. It seems that it pauses by default.
Logged
jonib
JkDefrag Hero
*****
Posts: 810


View Profile
« Reply #8 on: July 18, 2009, 07:32:59 pm »

Thanks for the suggestion. However the annoyance is: there aren't any Pause() command in the script. It seems that it pauses by default.
Are you sure you look at the right script? I don't think there is any default pauses in MyDefrag.

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