How can I make pre-exec and post-exec work ?

As of version 2.6.7, rsync server can kick scripts before and after transfers. You can use the recipe below to implement this very handy functionality in cwrsync server:

  1. Install Copssh and Cwrsync Server.
  2. Start a windows command shell from cwrsync start menu and make a copy of bash.exe as sh.exe in the bin directory.

    copy bin\bash.exe bin\sh.exe
  3. Create two script files in the bin directory for pre-exec operations:

    c:\program files\ICW\bin\pre-exec.sh



    # Shell script for your pre-exec operations
    cmd /c "c:\program files\ICW\bin\pre-exec.cmd"
    exit 0




    c:\program files\ICW\bin\pre-exec.cmd




    @ECHO OFF
    .....
  4. Create two script files for post-exec operations as described above.
  5. Update your rsyncd.conf file:




    # Module definitions
    [test]
    path = .....
    ......
    pre-xfer exec = /bin/pre-exec.sh
    post-xfer exec = /bin/post-exec.sh