No announcement yet.

FTP synch strategy (aka beating a dead horse)

  • Filter
  • Time
  • Show
Clear All
new posts

  • FTP synch strategy (aka beating a dead horse)

    I'm trying to figure out a comprehensive solution for reliable "one click" synchronization solution that works for ftp, and tell me if I'm on the right track--this is of course not as easy as using a standard Windows file system copy, but hey, you fight the war with the army you have, right?

    This is what I've come up with (in abbreviated syntax):

    1) sync mirror local->remote (push all the files out there)
    2) touch remote->local (Make the local timestamps match the timestamps on the ftp site.)

    1) Create/edit/update the local files.
    2) sync mirror local->remote COMPARING TIMESTAMPS ONLY, push out the new and updated files.
    3) touch remote->local (Making the local files reflect the date on the remote server.)

    But depending on the number of files and the speed of the connection this could take forever because wouldn't it re-touch all local files? If possible I would want to just touch the local files that need to be touched after being deployed. How would I do that?

    Or is there a better way to do this?


  • #2
    Re: FTP synch strategy (aka beating a dead horse)

    You could select only the different files, and then touch.
    assuming left is the local, rt is the ftp

    expand all
    select lt.newer.files lt.older.files
    touch rt->lt

    The reason to use newer/older, rather than diff, is newer older uses timestamps, while diff uses the content comparison (which you theoretically don't need if you manage the timestamps correctly).

    Does anyone else have access to this ftp, where they could potentially upload a file and change the ftp's timestamp?
    Aaron P Scooter Software