Script the mirror copy of folders and output the times

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jvunguyen
    New User
    • Mar 2016
    • 2

    Script the mirror copy of folders and output the times

    Hello

    I setup the session to copy and mirror the folder from the left to the right. I would like execute the script daily to mirror the folders from left to the right folder (copy the newer/update files from the left to the right and delete any orphaned files on the rights, delete any folder/files on the left side that are not exists on the right side). After executing the script, I like to have the output of the successfully copied number of files and how long it takes to the text file.

    Here is my script called: "JNBCscript.txt
    load "ScriptTest"
    option confirm:yes-to-all
    sync mirror:right->left
    folder-report layout:summary &
    options:display-mismatches &
    output-to:"c:\data\bc\jnbcscriptout.txt"

    I have the batch file called: JNBCScriptBat.bat
    bcompare @"c:\data\bc\JNBCscript.txt" /closescript

    The output of jnbcscriptout.txt
    Folder Compare
    Produced: 3/3/2016 2:50:23 PM

    Mode: Differences
    Left base folder: C:\TEST1
    Right base folder: Q:\AdmTemp\jn\TEST2

    Left Orphan Files (0) Size Modified
    ------------------------------------

    Right Orphan Files (0) Size Modified
    ------------------------------------

    Left Newer Files (0) Size Modified
    ------------------------------------

    Right Newer Files (0) Size Modified
    ------------------------------------

    Differences Files (0) Size Modified
    ------------------------------------

    I can not get the output summaries like
    3/3/2016 2:43:40 PM Username: Domain\abcuser
    3/3/2016 2:43:40 PM Load comparison: C:\TEST1 <-> Q:\AdmTemp\jn\TEST2
    3/3/2016 2:43:46 PM Successfully copied 101 items. Completed in 1.51 seconds.
    3/3/2016 2:51:38 PM Successfully copied 106 items. Completed in 0.89 seconds.

    Also, when I create the task schedule to run the batch file "JNBCScriptBat.bat", the task does not END properly. It shows "RUNNING", I have to manually end it to make the task become READY.

    Would anyone be able to help me?

    Thank you

    Johnathan
  • jvunguyen
    New User
    • Mar 2016
    • 2

    #2
    I think I found the solution
    log normal c:\data\bc\jnlog.txt
    load "ScriptTest"
    option confirm:yes-to-all
    sync mirror:right->left

    The output of the jnlog.txt
    3/4/2016 9:58:35 AM >> log normal c:\data\bc\jnlog.txt
    3/4/2016 9:58:35 AM >> load "ScriptTest"
    3/4/2016 9:58:35 AM Drive information for : C:\
    3/4/2016 9:58:35 AM Volume Name:
    3/4/2016 9:58:35 AM Drive Type: DRIVE_FIXED
    3/4/2016 9:58:35 AM File System: NTFS
    3/4/2016 9:58:35 AM Max Name Length: 255
    3/4/2016 9:58:35 AM Codepage: 1200
    3/4/2016 9:58:35 AM Samba Detected: False
    3/4/2016 9:58:35 AM File System Flags: Windows 7
    3/4/2016 9:58:35 AM Drive information for : Q:\
    3/4/2016 9:58:35 AM Volume Name:
    3/4/2016 9:58:35 AM Drive Type: DRIVE_REMOTE
    3/4/2016 9:58:35 AM File System: NTFS
    3/4/2016 9:58:35 AM Max Name Length: 255
    3/4/2016 9:58:35 AM Codepage: 1200
    3/4/2016 9:58:35 AM Samba Detected: False
    3/4/2016 9:58:35 AM File System Flags: Windows 7
    3/4/2016 9:58:35 AM Load comparison: C:\TEST1 <-> Q:\AdmTemp\jn\TEST2
    3/4/2016 9:58:35 AM >> option confirm:yes-to-all
    3/4/2016 9:58:35 AM >> sync mirror:right->left
    3/4/2016 9:58:35 AM Successfully synchronized 2 items. Completed in 0.02 seconds.
    3/4/2016 9:58:35 AM Script completed in 0.1 seconds

    Comment

    • Aaron
      Team Scooter
      • Oct 2007
      • 16002

      #3
      Correct, you would need the Log command to capture the run time. That information is not part of our Report output.

      As for the continuing to run: it seems likely it was not complete, but waiting for user input for a dialog. Adding Yes-to-All would answer yes to any dialogs automatically, and allow the script to continue. You could verify by running without Yes-to-All, but leaving the Log command in and reviewing the log.
      Aaron P Scooter Software

      Comment

      Working...