1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Synchronizing files

Discussion in 'Windows XP' started by Howard Brazee, Apr 19, 2010.

  1. Howard Brazee

    Howard Brazee Flightless Bird

    I synchronize some files with a Unix server with a batch file that
    contains the following commands:

    xcopy "%USERPROFILE%\My Documents\calendars\*.*"
    %mydrive%%mybase%calendars\*.* /Y/D /Exclude:c:/belfry\ICSexclude.txt

    Xcopy "%mydrive%%mybase%calendars" "%USERPROFILE%\My
    Documents\calendars\*.*" /Y/D

    (each of the above is one line).

    Trouble is, the Unix server must have slightly different time, so I
    get files copied every time I run this. So I downloaded Unison,
    renamed the text version and tried to figure out how to run it

    I downloaded Unison and am trying to use it, but so far haven't gotten
    the syntax to replace those lines. Is there a better way of doing
    this? Or do you have example .bat lines using Unison for this?


    Thanks.

    --
    "In no part of the constitution is more wisdom to be found,
    than in the clause which confides the question of war or peace
    to the legislature, and not to the executive department."

    - James Madison
     
  2. Pegasus [MVP]

    Pegasus [MVP] Flightless Bird

    "Howard Brazee" <howard@brazee.net> wrote in message
    news:q96ps51165eo2b53mqsiqgug6d2cu7jc9b@4ax.com...
    > I synchronize some files with a Unix server with a batch file that
    > contains the following commands:
    >
    > xcopy "%USERPROFILE%\My Documents\calendars\*.*"
    > %mydrive%%mybase%calendars\*.* /Y/D /Exclude:c:/belfry\ICSexclude.txt
    >
    > Xcopy "%mydrive%%mybase%calendars" "%USERPROFILE%\My
    > Documents\calendars\*.*" /Y/D
    >
    > (each of the above is one line).
    >
    > Trouble is, the Unix server must have slightly different time, so I
    > get files copied every time I run this. So I downloaded Unison,
    > renamed the text version and tried to figure out how to run it
    >
    > I downloaded Unison and am trying to use it, but so far haven't gotten
    > the syntax to replace those lines. Is there a better way of doing
    > this? Or do you have example .bat lines using Unison for this?
    >
    >
    > Thanks.


    xcopy.exe has been deprecated for some time. I recommend you use
    robocopy.exe with this switch:

    /FFT :: assume FAT File Times (2-second granularity).

    I believe the third-party tool xxcopy.exe has a similar switch.
     
  3. Pegasus [MVP]

    Pegasus [MVP] Flightless Bird

    "Howard Brazee" <howard@brazee.net> wrote in message
    news:q96ps51165eo2b53mqsiqgug6d2cu7jc9b@4ax.com...
    > I synchronize some files with a Unix server with a batch file that
    > contains the following commands:
    >
    > xcopy "%USERPROFILE%\My Documents\calendars\*.*"
    > %mydrive%%mybase%calendars\*.* /Y/D /Exclude:c:/belfry\ICSexclude.txt
    >
    > Xcopy "%mydrive%%mybase%calendars" "%USERPROFILE%\My
    > Documents\calendars\*.*" /Y/D
    >
    > (each of the above is one line).
    >
    > Trouble is, the Unix server must have slightly different time, so I
    > get files copied every time I run this. So I downloaded Unison,
    > renamed the text version and tried to figure out how to run it
    >
    > I downloaded Unison and am trying to use it, but so far haven't gotten
    > the syntax to replace those lines. Is there a better way of doing
    > this? Or do you have example .bat lines using Unison for this?
    >
    >
    > Thanks.
    >
    > --
    > "In no part of the constitution is more wisdom to be found,
    > than in the clause which confides the question of war or peace
    > to the legislature, and not to the executive department."
    >
    > - James Madison


    Hobocopy (http://sourceforge.net/projects/wangdera/files/HoboCopy/) is
    another possibility. It has this switch:

    /incremental - Perform an incremental copy. Only files that have
    changed since the last full copy will be copied.
     
  4. Howard Brazee

    Howard Brazee Flightless Bird

    On Mon, 19 Apr 2010 20:56:36 +0200, "Pegasus [MVP]"
    <news@microsoft.com> wrote:

    >Hobocopy (http://sourceforge.net/projects/wangdera/files/HoboCopy/) is
    >another possibility. It has this switch:
    >
    >/incremental - Perform an incremental copy. Only files that have
    > changed since the last full copy will be copied.
    >


    I downloaded this and tried hobocopy /? to get a window saying this
    isn't a valid Win32 application.

    --
    "In no part of the constitution is more wisdom to be found,
    than in the clause which confides the question of war or peace
    to the legislature, and not to the executive department."

    - James Madison
     
  5. Howard Brazee

    Howard Brazee Flightless Bird

    On Mon, 19 Apr 2010 20:49:33 +0200, "Pegasus [MVP]"
    <news@microsoft.com> wrote:

    >xcopy.exe has been deprecated for some time. I recommend you use
    >robocopy.exe with this switch:
    >
    > /FFT :: assume FAT File Times (2-second granularity).
    >
    >I believe the third-party tool xxcopy.exe has a similar switch.


    That looks good. Some other syntax appears to be different, I don't
    see an option for /Exclude:c:/belfry\myExclude.txt so I have to play
    around a bit.

    --
    "In no part of the constitution is more wisdom to be found,
    than in the clause which confides the question of war or peace
    to the legislature, and not to the executive department."

    - James Madison
     
  6. Pegasus [MVP]

    Pegasus [MVP] Flightless Bird

    "Howard Brazee" <howard@brazee.net> wrote in message
    news:jqaps51149mrvlf4s99jc7491heuf0pd17@4ax.com...
    > On Mon, 19 Apr 2010 20:56:36 +0200, "Pegasus [MVP]"
    > <news@microsoft.com> wrote:
    >
    >>Hobocopy (http://sourceforge.net/projects/wangdera/files/HoboCopy/) is
    >>another possibility. It has this switch:
    >>
    >>/incremental - Perform an incremental copy. Only files that have
    >> changed since the last full copy will be copied.
    >>

    >
    > I downloaded this and tried hobocopy /? to get a window saying this
    > isn't a valid Win32 application.


    This is a sure sign of a corrupted download.
     
  7. Howard Brazee

    Howard Brazee Flightless Bird

    On Mon, 19 Apr 2010 20:49:33 +0200, "Pegasus [MVP]"
    <news@microsoft.com> wrote:

    >xcopy.exe has been deprecated for some time. I recommend you use
    >robocopy.exe with this switch:
    >
    > /FFT :: assume FAT File Times (2-second granularity).


    Does robocopy have a limit in string length?

    I tried this:
    robocopy "C:/Documents and Settings\brazee\Application
    Data\Mozilla\Firefox\Profiles\4iakaiea.default\" "C:/Documents and
    Settings\brazee\My Documents\" bookmarks.html /E/XN/FFT


    and got back:

    Source - C:/Documents and Settings\brazee\Application
    Data\Mozilla\Firefox\Pr
    ofiles\4iakaiea.default" C:/Documents\
    Dest - C:/BELFRY\and\

    Files :
    Options : /COPY:DAT /R:1000000 /W:30

    ------------------------------------------------------------------------------

    ERROR : Invalid Parameter #3 : "Settings\brazee\My"

    --
    "In no part of the constitution is more wisdom to be found,
    than in the clause which confides the question of war or peace
    to the legislature, and not to the executive department."

    - James Madison
     
  8. Howard Brazee

    Howard Brazee Flightless Bird

    On Mon, 19 Apr 2010 20:49:33 +0200, "Pegasus [MVP]"
    <news@microsoft.com> wrote:

    >I believe the third-party tool xxcopy.exe has a similar switch.


    XXCopy tells me it's not a WIN32 application either.

    --
    "In no part of the constitution is more wisdom to be found,
    than in the clause which confides the question of war or peace
    to the legislature, and not to the executive department."

    - James Madison
     
  9. Howard Brazee

    Howard Brazee Flightless Bird

    On Mon, 19 Apr 2010 22:09:50 +0200, "Pegasus [MVP]"
    <news@microsoft.com> wrote:

    >> I downloaded this and tried hobocopy /? to get a window saying this
    >> isn't a valid Win32 application.

    >
    >This is a sure sign of a corrupted download.


    I'll try both hobocopy & XXcopy again, probably tomorrow (I'll be in
    meetings the rest of today).

    --
    "In no part of the constitution is more wisdom to be found,
    than in the clause which confides the question of war or peace
    to the legislature, and not to the executive department."

    - James Madison
     
  10. Bob CP

    Bob CP Flightless Bird

    On 4/19/2010 4:16 PM, Howard Brazee wrote:
    > On Mon, 19 Apr 2010 20:49:33 +0200, "Pegasus [MVP]"
    > <news@microsoft.com> wrote:
    >
    >> I believe the third-party tool xxcopy.exe has a similar switch.

    >
    > XXCopy tells me it's not a WIN32 application either.
    >

    Not exactly true. It runs in a "DOS" (command prompt) window as
    command-line application. As I remember it, there are both X32 and X64
    variations too.
     
  11. Pegasus [MVP]

    Pegasus [MVP] Flightless Bird

    "Howard Brazee" <howard@brazee.net> wrote in message
    news:f2eps5l5gpj6kibad4ck87p9779ubmjl0u@4ax.com...
    > On Mon, 19 Apr 2010 20:49:33 +0200, "Pegasus [MVP]"
    > <news@microsoft.com> wrote:
    >
    >>xcopy.exe has been deprecated for some time. I recommend you use
    >>robocopy.exe with this switch:
    >>
    >> /FFT :: assume FAT File Times (2-second granularity).

    >
    > Does robocopy have a limit in string length?
    >
    > I tried this:
    > robocopy "C:/Documents and Settings\brazee\Application
    > Data\Mozilla\Firefox\Profiles\4iakaiea.default\" "C:/Documents and
    > Settings\brazee\My Documents\" bookmarks.html /E/XN/FFT
    >
    >
    > and got back:
    >
    > Source - C:/Documents and Settings\brazee\Application
    > Data\Mozilla\Firefox\Pr
    > ofiles\4iakaiea.default" C:/Documents\
    > Dest - C:/BELFRY\and\
    >
    > Files :
    > Options : /COPY:DAT /R:1000000 /W:30
    >
    > ------------------------------------------------------------------------------
    >
    > ERROR : Invalid Parameter #3 : "Settings\brazee\My"


    While it is sometimes permissible to omit the space between parameters,
    doing so is a bad habit and can catch you out, e.g. with robocopy. It is one
    of my principles to always put at least one space between any two
    parameters.

    Having trailing backslashes for folder names is sometimes permissible,
    required or forbidden. In your case it is forbidden.

    I do not think that backing up bookmarks.html is sufficient for a
    restoration of your Firefox bookmarks. On the other hand I have not tested
    this lately.
     
  12. Terry R.

    Terry R. Flightless Bird

    On 4/19/2010 1:12 PM On a whim, Howard Brazee pounded out on the keyboard

    > On Mon, 19 Apr 2010 20:49:33 +0200, "Pegasus [MVP]"
    > <news@microsoft.com> wrote:
    >
    >> xcopy.exe has been deprecated for some time. I recommend you use
    >> robocopy.exe with this switch:
    >>
    >> /FFT :: assume FAT File Times (2-second granularity).

    >
    > Does robocopy have a limit in string length?
    >
    > I tried this:
    > robocopy "C:/Documents and Settings\brazee\Application
    > Data\Mozilla\Firefox\Profiles\4iakaiea.default\" "C:/Documents and
    > Settings\brazee\My Documents\" bookmarks.html /E/XN/FFT
    >
    >
    > and got back:
    >
    > Source - C:/Documents and Settings\brazee\Application
    > Data\Mozilla\Firefox\Pr
    > ofiles\4iakaiea.default" C:/Documents\
    > Dest - C:/BELFRY\and\
    >
    > Files :
    > Options : /COPY:DAT /R:1000000 /W:30
    >
    > ------------------------------------------------------------------------------
    >
    > ERROR : Invalid Parameter #3 : "Settings\brazee\My"
    >


    Hi Howard,

    This has nothing to do with your backup issue, but with Firefox
    bookmarks. What version of FF are you using? Since version 3,
    bookmarks are now stored in a SQLite database file named
    "places.sqlite". Unless you have your bookmarks exported on program
    close, your bookmarks.html file will be outdated.


    Terry R.
    --
    Anti-spam measures are included in my email address.
    Delete NOSPAM from the email address after clicking Reply.
     
  13. Howard Brazee

    Howard Brazee Flightless Bird

    On Tue, 20 Apr 2010 00:20:16 +0200, "Pegasus [MVP]"
    <news@microsoft.com> wrote:

    >While it is sometimes permissible to omit the space between parameters,
    >doing so is a bad habit and can catch you out, e.g. with robocopy. It is one
    >of my principles to always put at least one space between any two
    >parameters.
    >
    >Having trailing backslashes for folder names is sometimes permissible,
    >required or forbidden. In your case it is forbidden.


    I kept looking at syntax, but the rules weren't defined. The
    documentation seemed to think the obvious stuff didn't need to be
    defined. But it wan't obvious to me.

    >I do not think that backing up bookmarks.html is sufficient for a
    >restoration of your Firefox bookmarks. On the other hand I have not tested
    >this lately.


    It isn't, at least after Firefox changed to a database. But having
    them as an HTML file somewhere may be useful. My batch file does a
    lot more backups, I just picked the simplest example for this thread,
    solving one thing at a time. Most of the others use exclude files.

    --
    "In no part of the constitution is more wisdom to be found,
    than in the clause which confides the question of war or peace
    to the legislature, and not to the executive department."

    - James Madison
     
  14. Howard Brazee

    Howard Brazee Flightless Bird

    On Mon, 19 Apr 2010 15:51:08 -0700, "Terry R." <F1Com@NOSPAMpobox.com>
    wrote:

    >Hi Howard,
    >
    >This has nothing to do with your backup issue, but with Firefox
    >bookmarks. What version of FF are you using? Since version 3,
    >bookmarks are now stored in a SQLite database file named
    >"places.sqlite". Unless you have your bookmarks exported on program
    >close, your bookmarks.html file will be outdated.


    It's an old backup .bat file. I never got rid of that code, but it
    was an easy line to test robocopy. The places.sqlite actually gets
    backed up at home, after being synchronized with XMarks, so I haven't
    worried about it.

    --
    "In no part of the constitution is more wisdom to be found,
    than in the clause which confides the question of war or peace
    to the legislature, and not to the executive department."

    - James Madison
     
  15. Howard Brazee

    Howard Brazee Flightless Bird

    I wonder if someone can tell me what's wrong here:

    test.bat =
    ======================================================
    dir c:/belfry\test.bat
    dir e:/Copy\belfry\test.bat
    robocopy "C:/belfry" "E:/Copy\belfry" test.bat /E /XN /FFT

    pause
    ======================================================

    C:/BELFRY>test

    C:/BELFRY>dir c:/belfry\test.bat
    Volume in drive C has no label.
    Volume Serial Number is 0434-350F

    Directory of c:/belfry

    04/20/2010 10:40 AM 123 test.bat
    1 File(s) 123 bytes
    0 Dir(s) 16,010,420,224 bytes free

    C:/BELFRY>dir e:/Copy\belfry\test.bat
    The system cannot find the file specified.

    C:/BELFRY>robocopy "C:/belfry" "E:/Copy\belfry" test.bat /E /XN /FFT

    -------------------------------------------------------------------------------
    ROBOCOPY :: Robust File Copy for Windows :: Version
    XP010
    -------------------------------------------------------------------------------

    2010/04/20 10:43:39 ERROR 2 (0x00000002) Creating Destination
    Directory E:/Copy\
    belfry\
    The system cannot find the file specified.
    Waiting 30 seconds... Retrying...
    2010/04/20 10:44:09 ERROR 2 (0x00000002) Creating Destination
    Directory E:/Copy\
    belfry\
    The system cannot find the file specified.
    Waiting 30 seconds... Retrying...
    2010/04/20 10:44:40 ERROR 2 (0x00000002) Creating Destination
    Directory E:/Copy\
    belfry\
    The system cannot find the file specified.
    Waiting 30 seconds... Retrying...
    2010/04/20 10:45:10 ERROR 2 (0x00000002) Creating Destination
    Directory E:/Copy\
    belfry\
    The system cannot find the file specified.
    Waiting 30 seconds...

    --
    "In no part of the constitution is more wisdom to be found,
    than in the clause which confides the question of war or peace
    to the legislature, and not to the executive department."

    - James Madison
     
  16. Pegasus [MVP]

    Pegasus [MVP] Flightless Bird

    "Howard Brazee" <howard@brazee.net> wrote in message
    news:uocrs5hdnpil0gcof752omo80vhou1suui@4ax.com...
    > On Tue, 20 Apr 2010 00:20:16 +0200, "Pegasus [MVP]"
    > <news@microsoft.com> wrote:
    >
    >>While it is sometimes permissible to omit the space between parameters,
    >>doing so is a bad habit and can catch you out, e.g. with robocopy. It is
    >>one
    >>of my principles to always put at least one space between any two
    >>parameters.
    >>
    >>Having trailing backslashes for folder names is sometimes permissible,
    >>required or forbidden. In your case it is forbidden.

    >
    > I kept looking at syntax, but the rules weren't defined. The
    > documentation seemed to think the obvious stuff didn't need to be
    > defined. But it wan't obvious to me.


    It wasn't obvious to me either - I found out by trial and error.
     
  17. Pegasus [MVP]

    Pegasus [MVP] Flightless Bird

    "Howard Brazee" <howard@brazee.net> wrote in message
    news:9fmrs5tdqmkkhvug75ck27s6m2h0geokn5@4ax.com...
    > I wonder if someone can tell me what's wrong here:
    >
    > test.bat =
    > ======================================================
    > dir c:/belfry\test.bat
    > dir e:/Copy\belfry\test.bat
    > robocopy "C:/belfry" "E:/Copy\belfry" test.bat /E /XN /FFT
    >
    > pause
    > ======================================================
    >


    There is nothing wrong with the batch file - it works perfectly on my
    machine - but there is something wrong with drive E: on your machine. I
    would test things from a Command Prompt like so:

    md E:/Copy\Belfry
    copy c:/belfry\test.bat e:/copy\Belfry
     
  18. Howard Brazee

    Howard Brazee Flightless Bird

    On Tue, 20 Apr 2010 20:13:36 +0200, "Pegasus [MVP]"
    <news@microsoft.com> wrote:

    >There is nothing wrong with the batch file - it works perfectly on my
    >machine - but there is something wrong with drive E: on your machine. I
    >would test things from a Command Prompt like so:
    >
    >md E:/Copy\Belfry
    >copy c:/belfry\test.bat e:/copy\Belfry


    E: is an external Unix drive, but the file exists.

    Interesting, I changed the batch file:
    Xcopy "C:/belfry\test.bat" "E:/Copy\belfry\*.*"
    robocopy "C:/belfry" "E:/Copy\belfry" "test.bat" /E /XN /FFT /R:3

    This time the robocopy ran, skipping the copy. I infer that somehow
    robocopy doesn't have the access that xcopy does to this drive.

    I changed the E: to a Y: and ran robocopy to copy to my iPod, it
    worked.




    --
    "In no part of the constitution is more wisdom to be found,
    than in the clause which confides the question of war or peace
    to the legislature, and not to the executive department."

    - James Madison
     
  19. Howard Brazee

    Howard Brazee Flightless Bird


    >Interesting, I changed the batch file:
    >Xcopy "C:/belfry\test.bat" "E:/Copy\belfry\*.*"
    >robocopy "C:/belfry" "E:/Copy\belfry" "test.bat" /E /XN /FFT /R:3
    >
    >This time the robocopy ran, skipping the copy. I infer that somehow
    >robocopy doesn't have the access that xcopy does to this drive.
    >
    >I changed the E: to a Y: and ran robocopy to copy to my iPod, it
    >worked.


    Now robocopy can create the file, which it couldn't before. It's as
    though once it creates the file once, it knows how. I'm puzzled. I
    need to trust it to copy new files.

    I've been getting weird stuff all day though, with me running batch
    jobs that seem to be previous runs, with commands I got rid of. I'm
    going to reboot.

    --
    "In no part of the constitution is more wisdom to be found,
    than in the clause which confides the question of war or peace
    to the legislature, and not to the executive department."

    - James Madison
     

Share This Page