locked
Syncing only when connected to home network RRS feed

  • Question

  • I would like to sync when my laptop is connected to my home network.  What will happen if I add synctoy to my startup list so that it runs on every boot-up and one of the folders in a pair is not available because I'm not connected to the hoem network?  Is there any harm if it merely fails because the folder is not available?  Is there a better way to accomplish my orjective?
    Sunday, January 4, 2009 9:52 PM

Answers

  • Here are some instructions on how you can schedule SyncToy to run automatically:

     

    http://www.mydigitallife.info/2008/01/01/schedule-synctoy-to-run-and-automatically-and-repetitively/

     

     

    Tuesday, January 6, 2009 7:59 PM
  • If the folder is unavailable, the sync will just fail and report failure. It will not retry either periodically or until the location is available.

     

    If you are familiar with command line stuff, uou could write your own batch file though that could keep pinging the destination until it is available and the kick off synctoy when it is.

    Thursday, January 8, 2009 9:11 PM
  • actually I did end up going that route.  Here is the batch file I use to check whether the network drive is mounted before running SyncToy (need to put an empty "exist.txt" in the root of the drive), seems to be working:

    Code Snippet

    @echo off
    if exist "P:\exist.txt" goto update
    goto noupdate
    :update
    cls
    echo The network drive is mounted.  Updating local copy of files...
    "C:\Program Files\SyncToy 2.0\SyncToyCmd.exe"/R
    if %ERRORLEVEL% NEQ 0 goto error
    goto done
    :noupdate
    cls
    echo The network drive is unavailable.  Local copy not updated.
    goto done
    :error
    echo There was an error running the network sync.  Please notify the administrator.
    pause
    :done



    Oh and I put a shortcut to it in the startup folder in the start menu, so it runs at login.  You could also run it as a scheduled task, I presume.
    Friday, January 9, 2009 3:57 PM

All replies

  • Here are some instructions on how you can schedule SyncToy to run automatically:

     

    http://www.mydigitallife.info/2008/01/01/schedule-synctoy-to-run-and-automatically-and-repetitively/

     

     

    Tuesday, January 6, 2009 7:59 PM
  • There is lots of information on how to schedule SyncToy.  What the OP is asking (and what I want to know also) is what will happen if SyncToy starts and runs when the source folder is not available?  I want to use SyncToy to copy files from a network drive to a laptop daily, but there may be cases when the laptop is roaming and the network drive is unavailable.  What is SyncToy's behavior in this case?
    Thursday, January 8, 2009 4:35 PM
  • If the folder is unavailable, the sync will just fail and report failure. It will not retry either periodically or until the location is available.

     

    If you are familiar with command line stuff, uou could write your own batch file though that could keep pinging the destination until it is available and the kick off synctoy when it is.

    Thursday, January 8, 2009 9:11 PM
  • actually I did end up going that route.  Here is the batch file I use to check whether the network drive is mounted before running SyncToy (need to put an empty "exist.txt" in the root of the drive), seems to be working:

    Code Snippet

    @echo off
    if exist "P:\exist.txt" goto update
    goto noupdate
    :update
    cls
    echo The network drive is mounted.  Updating local copy of files...
    "C:\Program Files\SyncToy 2.0\SyncToyCmd.exe"/R
    if %ERRORLEVEL% NEQ 0 goto error
    goto done
    :noupdate
    cls
    echo The network drive is unavailable.  Local copy not updated.
    goto done
    :error
    echo There was an error running the network sync.  Please notify the administrator.
    pause
    :done



    Oh and I put a shortcut to it in the startup folder in the start menu, so it runs at login.  You could also run it as a scheduled task, I presume.
    Friday, January 9, 2009 3:57 PM
  • Thanks for the bat file.  I was pleasantly surprised that the following worked.

    if exist '\\192.168.0.2\c\My folder" ...

    I used an actual folder on my home computer instead of creating a dummy.
    Friday, January 9, 2009 10:11 PM