Announcement

Collapse
No announcement yet.

Folder Synchronization Between Computers

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Folder Synchronization Between Computers

    I'd like to synchronize a folder on my home and office PC. My first thought was to use Beyond Compare (my favorite folder sync tool) but that app doesn't work over the internet.

    In another thread, Raymond mentioned a tool called Syncovery, which I've taken a look at.

    I've used services such as SOS, but generally haven't been happy with the amount of effort it takes to keep them running.

    As an alternative, simply syncing a folder on my server to a folder on my PC (basically synchronized backup) would be good enough.

    Looking at the various options out there, it's hard to find something very basic. Vendors seem to want to highlight their very cool features, when all I want is an on-demand synchronization between a folder on 2 PCs (or on a server and a PC).

    Would it be that hard to create a simple server/PC sync app using PowerBASIC? The only task of significance would see to be getting the server folder/file structure. With that in hand I should be able to write the PowerBASIC code to send the appropriate FTP commands to make the sync happen. I'll have to look into that, but a ready-made solution would be best.

    Suggestions?


  • #2
    Or just get a good File Manager like DOpus where Sync is just one of it's many features.

    Comment


    • #3
      Hi Gary

      Why not try Winmerge ? You can download for free at http://winmerge.org/

      WinMerge is an Open Source differencing and merging tool for Windows.
      WinMerge can compare both folders and files, presenting differences in a
      visual text format that is easy to understand and handle.

      Comment


      • #4
        Gary, If you don't need all the features of Syncovery, SyncBackFree/Pro is another nice option. I don't think you get changed-block backups, but still plenty powerful for most day-to-day ops. I used SyncBackPro for years before moving to Syncovery for the extra features.

        Before you look at writing/picking, make sure you consider if you'll need to back up open files. These two will, but many others simply skip open files which wouldn't have worked for my environments. If that's important to you, make sure you consider in whatever decision you make.

        Comment


        • #5
          George/Anne,
          As best I can see from their documentation, DOPus and WinMerge do not work for syncing between computers at different locations.

          I'd like to synchronize a folder on my home and office PC
          Did I miss that feature?

          Comment


          • #6
            Hmm... I looked around and did not find an easy/obvious solution to the question of getting the subfolder/file structure of a folder on my server. I even call my server tech group and they weren't sure how to do it.

            Basically, I'd like the equivalent output of "Dir *.* /s", but for a folder on my server. The directory listing would not be visible for site visitors.

            Does anyone have a suggestion on how that would be done?

            Comment


            • #7
              Digging a bit more ... I see that PHP has functions which seem to be able to generate the list.

              But how does a site enable/disable a PHP script from generating the list? In this particular case, I want access to the file/folder structure for a folder on my site, but I don't want visitors in general to be able to access the list.

              Comment


              • #8
                Usually for Windows you'd use FindFirstFile and FindNextFile to list the contents of a folder.
                To do it for a remote folder you can use FTPFindFirstFile:
                https://msdn.microsoft.com/en-us/lib...(v=vs.85).aspx

                Comment


                • #9
                  Hi Paul,
                  Unfortunately I use a Unix server.

                  Comment


                  • #10
                    If it's just synching folders on different machines over the internet, Dropbox works great.

                    Comment


                    • #11
                      Gary: DOpus does Sync with FTP sites, but you do need to license the optional FTP support. I've never actually done the actual Sync, but I did test the Sync Compare function and it seemed to handle it fine. Overall DOpus is to be highly recommended.

                      Comment


                      • #12
                        Stuart,
                        I didn't know DropBox had sync capabilities. I'll go take a look.

                        George,
                        Likewise, when I went the DOpus page, I missed the FTP option. I'll go take a look at that as well.

                        Comment


                        • #13
                          Originally posted by Gary Beene View Post
                          Stuart,
                          I didn't know DropBox had sync capabilities. I'll go take a look
                          I do not use the sync capabilities myself, but they are highly regarded and I personally know several development teams who prefer DropBox for syncing code over the code-specific alternatives.

                          I am legally blind. Please forgive any typos. I do try and catch as many as I can.

                          Comment


                          • #14
                            After looking at the various options out there, I'm thinking that perhaps I could write an app that would sync between a server folder and a PC folder. I really want minimal capabilities - identify a folder on my PC and one on my server, set the direction of the mirror and have one of the two devices be sync'd with the other.

                            1. PowerBASIC app with Embedded browser
                            2. Create a password protected folder on the server via control panel on the server
                            3. Build a web page in the protected folder that returns the directory structure using PHP
                            4. Extract the file/folder list from the embedded browser
                            5. Extract a file/folder list from my PC folder
                            6. Compare the 2 lists
                            7. Delete files/folders on server as appropriate (PowerBASIC FTP code)
                            8. Upload new files/folders to server (PowerBASIC FTP code)

                            Something like that.

                            It won't be a super short utility, but it seems doable. The devil is in the details, as they say. Several parts of that I've not done before, but it looks like an interesting project.

                            On a quick test of a small server structure, I found a few PHP examples which generate a file/folder listing pretty quickly. I'll have to try it out on on a structure with 50K files to see how quickly it will respond.

                            It would be better yet if no server had to be in the loop, so I could sync a folder between 2 PCs. But I'm not sure how that would work. Maybe one of the web servers that are being discussed in another thread I started my give a clue. I have a lot to learn in that arena.

                            Comment


                            • #15
                              ISTM that the embedded browser is unnecessary and using a web page, protected or not, poses a security risk.
                              You can do it all with a FTP and it doesn't need to be under the www root.

                              I've done this for a couple of clients who need to regularly update the downloadable PDFs on their websites (Real Estate Liistings and Recruitment Position Applications).

                              I also have a similar setup for my own use that is outside of any www root so it's not accessible with a browser.

                              Just FTP into the server and change to the synch directory.

                              Then "ls" will return a directory list from the server which you can compare with your local directory listing.

                              (Just remember that "ls" will probably return file date/time in UTC, so you will need to convert to local time when checking for newer files.)
                              Once you have identified anomalies:
                              "delete" to remove any files for the server that are no longer in the local directory.
                              "put" for any files with a more recent file date
                              "put" for any files not on the server.

                              Comment


                              • #16
                                Originally posted by Gary Beene View Post
                                It would be better yet if no server had to be in the loop, so I could sync a folder between 2 PCs. But I'm not sure how that would work. Maybe one of the web servers that are being discussed in another thread I started my give a clue. I have a lot to learn in that arena.
                                Two way synch between two machines get tricky. It's fairly trivial to make sure that both have the most recent version of a file.

                                The problem comes when you have a file on Machine A which is not on Machine B.

                                There are two possibilites:
                                1. The file was on Machine B but has been deleted so it should be removed from Machine A
                                or
                                2. The file has been created on Machine A so should be copied to Machine B.

                                In that situation, you need to know when the file was created and when the computers where last synched. If the file is dated after the last sync, then copy it. If it is dated before the last synch, delete it.

                                If you just want Machine B to be the same as Machine A, it is much easier.

                                You can handle both of these situations with a very simple FTP server running on one of the machines.

                                Check out Baby FTP Server - they don't come simpler or easier to use than this: http://www.pablosoftwaresolutions.co...tp_server.html

                                Comment


                                • #17
                                  Hi Stuart!
                                  Thanks for ramping up the comments. What do you mean by "Is"?

                                  Then "ls" will return a directory list
                                  And, do you mean a directory list that contains all subfolders and files?

                                  Since I posted earlier, I realized that the embedded browser was overkill. I can simply use the URLDownloadToFile to capture the output of a password protected PHP page, which is essentially both steps 3 and 4 from my above list.

                                  I suppose that a PHP output could be sent encrypted, rather than as plain text, to address some of the security concern, but with the directory itself password protected, would capturing the plain text directory structure of the server folder be of any value to anyone? My knowledge of the security issue is pretty minimal.

                                  Comment


                                  • #18
                                    Stuart,
                                    There are too many parts of this story which I've not worked with before, making my brain hurt!

                                    There are 2 syncing scenarios with FTP servers involved in the solution.

                                    1. When we're talking syncing machine A to machine B, where both are just PCs such as at home and office, running an FTP server on one of the two would seem appropriate.

                                    2. In the case of a 3-machine approach, such as home-website-office, and where the web site machine already runs an FTP server, I'd think the syncing solution would be different, and perhaps easier to accomplish?

                                    I have an interest in understanding both solutions, but I'm stretched for time right now so a solution along the lines of post #14 might be easier for me achieve in the short term because the other solutions will require more of a learning curve than I can spend right now.

                                    I'll have to do some more due diligence before I can say for sure which represents the most time to complete.

                                    However, you've caught my attention with your security comment so I'm strongly interested in your response to my question in post #17.

                                    Comment


                                    • #19
                                      Sorry, not thinking. "ls" (ell-ess) or LIST is the UNIX FTP command to provide a directory listing. Same as DIR.
                                      Last edited by Stuart McLachlan; 14 May 2018, 06:51 AM.

                                      Comment


                                      • #20
                                        Originally posted by Anne Wilson View Post
                                        Hi Gary
                                        Why not try Winmerge ? You can download for free at http://winmerge.org/
                                        WinMerge, which I use myself, serves a different purpose. It visualizes differences in text files and let you edit those. Syncing is a different topic.

                                        Well, again, there are a couple of options. If you have a Google account, Google Drive (drive.google.com) comes along with it free. It has a desktop companion app, that allows syncing over a devices.

                                        For a free offline tool, I use MS' SyncToy. That's not automated, though:https://www.microsoft.com/en-us/down....aspx?id=15155

                                        For doing syncs on (Linux) FTP servers, do a web search for a tuturial in hiw to use the Linux tool RSync.

                                        Comment

                                        Working...
                                        X