Script check please

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • fdf
    Journeyman
    • Jun 2007
    • 13

    Script check please

    I haven't installed this yet but I hoped someone might do a quick review and let me know if
    you see any glaring errors. Any nomenclature or convention suggestions also be appreciated.

    This procedure will maintain the contents of desktop file "705.zip" by automatically copying
    selected *.o files from folder U:\usr5\705 and its sub-directories into the desktop file 705.zip,
    checking for updates every 30 seconds.

    1. Create a complete folder compare session in the graphical interface. Save as "705zip"

    2. Create an instruction file (and save as C:\705zip.inst)

    log verbose "C:\users\eaf\desktop\705zip.log"
    criteria rules-based
    load "705zip"
    filter "*.o";"-705x"
    expand all
    select left.newer.files left.orphan.files left.diff.files left.older.files
    confirm:yes-to-all
    copyto "U:\usr5\705" "C:\users\eaf\desktop\705.zip"

    3. Create a command script (and save as C:\705zip.cmnd)

    "C:\Program Files (x86)\Beyond Compare 4\BCompare.exe" @C:\705zip.inst

    4. Set up the task schedule:

    Navigate to Control Panel | System and Security | Administrative Tools | Scheduled Tasks.
    New | Task (starts add task wizard)
    Taskname 705zip
    Perform every 30 seconds
    Open Advanced Properties
    Edit the target to Run: @C:\705zip.cmnd
    Edit other settings per preference
    Check Task Enabled
    Don't check the /silent switch
    Finish

    Good to go?
  • Aaron
    Team Scooter
    • Oct 2007
    • 16001

    #2
    Hello,

    A few minor issues here and there. The first I would point out is that 30 seconds may be too short an interval. If the task is still running this could cause Windows Task Schedule to collide with the previous task run.

    A saved session from the graphical interface can contain the filter, criteria configuration, etc, so you do not need to reload these in script. Also, the copyto syntax is a bit off: it should pick a side (left or right depending on your session) then copy to the destination folder.

    log verbose "C:\users\eaf\desktop\705zip.log"
    load "705zip"
    expand all
    select left.newer.files left.orphan.files left.diff.files left.older.files
    confirm:yes-to-all
    copyto left "C:\users\eaf\desktop\705.zip"


    Task Scheduler should also be set to run as the same Windows User account that set up the "705zip" session. BC4 stores settings per user, so only this user would have the saved session. Alternatively, create a Portable Install during the setup wizard to a global location, such as C:\Tools\Beyond Compare 4\, and any User account running this install would share all settings.

    Lastly, I recommend testing with test folders/files first, using our fully functional trial. This way you can make sure your script is working as you expect in a test environment, before working with live data or before purchase is necessary.
    Aaron P Scooter Software

    Comment

    Working...