Announcement

Collapse
No announcement yet.

Automatically Sync Changed Files to Remote Server

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Automatically Sync Changed Files to Remote Server

    Is this possible in Dolphin? I see it is possible in Krusader, but Krusader looks like a GTK app(I assume it is mainly based on KDE3 still) and it also does not look like it would automaticly sync right when I modify a file. I want it to monitor the directory at least in a few minute intervals, and automaticly upload changed files to a remote server.
    OS: Kubuntu 12.10/Windows 8
    CPU: Intel Core i7 2600K
    Motherboard: Gigabyte GA-Z77X-UD5H
    Memory: 2x4GB Corsair Dominator
    Graphics Card: MSI R7770
    Monitor: Dell 2208WFP
    Mouse: Mionix NAOS 5000
    PSU: Corsair 520HX
    Case: Thermaltake Mozart TX
    Cooling: Thermalright TRUE Black Ultra-120 eXtreme CPU Heatsink Rev C
    Hard Drives: 1x180 GB Intel 330 SSD - 1xWD 1 TB Caviar Black - 1xWD 2 TB Caviar Green - 2xWD 3 TB Caviar Green

    #2
    Is it important that Dolphin does it itself?

    This would be straightforward to build with rsync and either a cron job or a long-running background script to call it.
    I'd rather be locked out than locked in.

    Comment


      #3
      No I suppose Dolph integration is not crucial. I just figured it would be nice to have it integrated in Dolphin but I suppose a cron job would work fine. Sometimes I still over look the simplicity of using the terminal at times. All those years of being a Windows user where there is barley ever a need for cli. I found this thread over at the Ubuntu Forums that should get the job done. I considered rscync but from what I can tell rsync itself still does not have this capability in itself but the script I linked to will fix that. Thanks for the tip SecretCode!
      OS: Kubuntu 12.10/Windows 8
      CPU: Intel Core i7 2600K
      Motherboard: Gigabyte GA-Z77X-UD5H
      Memory: 2x4GB Corsair Dominator
      Graphics Card: MSI R7770
      Monitor: Dell 2208WFP
      Mouse: Mionix NAOS 5000
      PSU: Corsair 520HX
      Case: Thermaltake Mozart TX
      Cooling: Thermalright TRUE Black Ultra-120 eXtreme CPU Heatsink Rev C
      Hard Drives: 1x180 GB Intel 330 SSD - 1xWD 1 TB Caviar Black - 1xWD 2 TB Caviar Green - 2xWD 3 TB Caviar Green

      Comment


        #4
        Tip: check, debug and verify your rsync statement before setting up the loop! Running every 5 seconds could kill your machine and network; even every 5 minutes could as well if you've accidentally specified the wrong source directory.

        Or if you later on put a symlink inside the folder you're backing up to your 2TB music and movies drive. (rsync option -x, --one-file-system would prevent this from being followed.)

        You'll need to copy timestamps and permissions so that the same file is not re-transferred in the next loop - the -a parameter is best if both source and target are unix-type file systems.

        Originally posted by Xplorer4x4 View Post
        All those years of being a Windows user where ...
        ... developers and marketers assume that every possible function including a kitchen sink has to be built into their app. With a gui.
        I'd rather be locked out than locked in.

        Comment


          #5
          Thanks for the debug tip. I actually thought about that after posting. I did look in to sleep and added 5m instead of 5. I think 5 min intervals should be fine.

          In regards to permissions, my server log in is not the same username as my system. Does that have an impact on permissions? The local folder is drwxrwxr-x and the remote is running as drwxr-sr-x. I tried to configure the server to use suid guid(sorry might have that wrong but I am sure you can figure out what I mean) so that the /var/www folder and it's contents should alway set ownership of the files to www-data:www-data but for some reason the numerous tutorials on this subject failed.

          So does this look about right:
          rsync -rxa ~/Desktop/devsite user@domain.com:/var/www/devsite/
          I added -r because I need it to sync child directories and those child directories have multiple child direcotries with in them, and it even drops down in to more child folder in locations.

          And both systems are Unix, Kubuntu desktop and the remote machine is running Ubuntu Server(Precise) with kubuntu-desktop installed.
          OS: Kubuntu 12.10/Windows 8
          CPU: Intel Core i7 2600K
          Motherboard: Gigabyte GA-Z77X-UD5H
          Memory: 2x4GB Corsair Dominator
          Graphics Card: MSI R7770
          Monitor: Dell 2208WFP
          Mouse: Mionix NAOS 5000
          PSU: Corsair 520HX
          Case: Thermaltake Mozart TX
          Cooling: Thermalright TRUE Black Ultra-120 eXtreme CPU Heatsink Rev C
          Hard Drives: 1x180 GB Intel 330 SSD - 1xWD 1 TB Caviar Black - 1xWD 2 TB Caviar Green - 2xWD 3 TB Caviar Green

          Comment


            #6
            I don't think you'll be able to synchronise / preserve owners - but does it matter what owner is set on the target server? If it's only www files you might be able to skip preserving owner (and tell rsync to ignore owner differences). Some experimentation and a bit of reading of man rsync should sort it out!
            I'd rather be locked out than locked in.

            Comment


              #7
              Right, I am not trying to synchronize owners in the since of having my ownership transfered to the server, but rather having the server take ownership as www-data:www-data. From what I have read this is most secure way to have a web server running. So ownership in rsync is not at issue here, so am I correct that something like this should be sufficient:
              rsync -rxa ~/Desktop/devsite user@domain.com:/var/www/devsite/
              OS: Kubuntu 12.10/Windows 8
              CPU: Intel Core i7 2600K
              Motherboard: Gigabyte GA-Z77X-UD5H
              Memory: 2x4GB Corsair Dominator
              Graphics Card: MSI R7770
              Monitor: Dell 2208WFP
              Mouse: Mionix NAOS 5000
              PSU: Corsair 520HX
              Case: Thermaltake Mozart TX
              Cooling: Thermalright TRUE Black Ultra-120 eXtreme CPU Heatsink Rev C
              Hard Drives: 1x180 GB Intel 330 SSD - 1xWD 1 TB Caviar Black - 1xWD 2 TB Caviar Green - 2xWD 3 TB Caviar Green

              Comment


                #8
                Try it and see!
                Originally posted by SecretCode View Post
                Some experimentation
                My only concern is that with -a rsync will try to preserve the owners, and perhaps on each run it will see that owners don't match and will do unnecessary work. Adding the --no-owner option would stop it from trying. I think.
                I'd rather be locked out than locked in.

                Comment


                  #9
                  Here is what I ended up with:
                  rsync -hvrx --no-owner --exclude .svn/ -i /some/local/place/autosync.log /some/local/folder user@server:/var/www/subdomains/somefolder
                  And it works great, but I am big confused why it is not writing to the log file I created and specified.
                  OS: Kubuntu 12.10/Windows 8
                  CPU: Intel Core i7 2600K
                  Motherboard: Gigabyte GA-Z77X-UD5H
                  Memory: 2x4GB Corsair Dominator
                  Graphics Card: MSI R7770
                  Monitor: Dell 2208WFP
                  Mouse: Mionix NAOS 5000
                  PSU: Corsair 520HX
                  Case: Thermaltake Mozart TX
                  Cooling: Thermalright TRUE Black Ultra-120 eXtreme CPU Heatsink Rev C
                  Hard Drives: 1x180 GB Intel 330 SSD - 1xWD 1 TB Caviar Black - 1xWD 2 TB Caviar Green - 2xWD 3 TB Caviar Green

                  Comment

                  Working...
                  X