BC4 in batch not creating log file

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Mutos
    Visitor
    • Jan 2015
    • 3

    BC4 in batch not creating log file

    Hi all,


    I used BC2 for Windows to daily synch two data drives by way of a batch. Now I've migrated under Linux (14.10 Utopic Unicorn) and I can't get my batch to create the log file as it did previously.

    Here is what I did :

    My initial batch under Windows was the following :

    C:\Batches\Synch-BC\BC2-NAS-008.bat
    Code:
    "c:\Program Files (x86)\BeyondCompare2\BC2.exe" %@ C:\Batches\Synch-BC\BC2-NAS-007.bc2
    C:\Batches\Synch-BC\BC2-NAS-007.bc2
    Code:
    # Set logging
    log C:\Batches\Synch-BC\Logs\BC2-NAS-%date%-%fn_time%.log
    log verbose
    
    # Display no prompt
    option confirm:yes-to-all
    
    # Load comparison
    load "Disque Dur RĂ©seau"
    
    # Synchronize the right folder to the left
    sync create-empty mirror:lt->rt
    
    # Make sure the timestamps are correctly in sync
    expand all
    select right.newer right.older
    touch lt->rt
    I first copied my batch folder from my old Windows folder (C:\Batches) into a ~/bin folder. So now I got a ~/bin/Synch-BC folder containing everything.

    Then I translated the .bat into a .sh and changed the log file and session in the .bc2, of course after recreating an equivalent session :

    ~/bin/Synch-BC\BC2-NAS-008.sh
    Code:
    #!/bin/bash  
    /usr/bin/bcompare "@~/bin/Synch-BC/BC2-NAS-007.bc2"
    ~/bin/Synch-BC\BC2-NAS-007.bc2
    Code:
    # Set logging
    log ~/bin/Synch-BC/Logs/BC2-NAS-%date%-%fn_time%.log
    log verbose
    
    # Display no prompt
    option confirm:yes-to-all
    
    # Load comparison
    load "/Reseau/DisqueComplet"
    
    # Synchronize the right folder to the left
    sync create-empty mirror:lt->rt
    
    # Make sure the timestamps are correctly in sync
    expand all
    select right.newer right.older
    touch lt->rt
    However, when I run the .sh from a shell, it loads BC4, then pops up a message :
    Code:
    03/01/2015 12:10:19  Fatal Scripting Error: Cannot create file "/home/leschouchous/bin/Synch-BC/Logs/BC2-NAS-2015-01-03-12-10-19.log". Aucun fichier ou dossier de ce type
    The French part of the message "Aucun fichier ou dossier de ce type" means "No file or folder of that type".

    I have no idea of this error's cause. I tried to touch the file with the full path copied from the error message, and the file was successfully created. I tried to run the script with the file already existing. I even tried to sudo the script, to no avail.

    Thanks for any help and a good 2015 Year to all BC users !
  • Aaron
    Team Scooter
    • Oct 2007
    • 16002

    #2
    Hello,

    Thanks for the report. The issue is the use of the "~", which is not currently supported. If you use the full path, then the log command will work as expected.

    I would recommend generating a report first, instead of performing the Sync command. A sync command will not preview before acting, and there is no way to Undo after the action has occurred. If you are going to sync, I would recommend testing on Test folders first, to make certain it will proceed as expected before using on live data.

    Touching may not longer be necessary, depending on your Source and Target, and if the copy/Sync commands are able to preserve this information during the copy.
    Aaron P Scooter Software

    Comment

    • Mutos
      Visitor
      • Jan 2015
      • 3

      #3
      Thanks Aaron,


      Good answer, just tested and it works ! So stupid of me to not have tried that, it could have been a logical way to go, to downgrade all parameters syntax to the bare standard minimum !

      As for the synch, the idea is, that I'm just translating a batch that worked daily for months now. Anyway, I manually tested it a number of times to make sure the comparison was OK before activating actual mirrorring. My goal is to daily replicate HD data on the NAS.

      As for touching, it's just a safe extra to be sure, I've not investigated if it's actually mandatory.

      Thanks for your answer and sure I'll keep using Beyond Compare ! For now I've not found any better synch software, and by large ! Also, I've read about your dev issues with the Borland platforms and I hope they'll soon be solved, without too much hard work to port the soft on more up-to-date platforms.

      Comment

      Working...