Keep Remote Directory Up-to-date

后端 未结 17 1711
一向
一向 2021-01-30 06:39

I absolutely love the Keep Remote Directory Up-to-date feature in Winscp. Unfortunately, I can\'t find anything as simple to use in OS X or Linux. I know the same thing can

相关标签:
17条回答
  • 2021-01-30 07:31

    You can also use Fetch as an SFTP client, and then edit files directly on the server from within that. There are also SSHFS (mount an ssh folder as a Volume) options. This is in line with what stimms said - are you sure you want stuff kept in sync, or just want to edit files on the server?

    OS X has it's own file notifications system - this is what Spotlight is based upon. I haven't heard of any program that uses this to then keep things in sync, but it's certainly conceivable.

    I personally use RCS for this type of thing:- whilst it's got a manual aspect, it's unlikely I want to push something to even the test server from my dev machine without testing it first. And if I am working on a development server, then I use one of the options given above.

    0 讨论(0)
  • 2021-01-30 07:32

    It seems like perhaps you're solving the wrong problem. If you're trying to edit files on a remote computer then you might try using something like the ftp plugin for jedit. http://plugins.jedit.org/plugins/?FTP This ensures that you have only one version of the file so it can't ever be out of sync.

    0 讨论(0)
  • 2021-01-30 07:34

    User watcher.py and rsync to automate this. Read the following step by step instructions here:

    http://kushellig.de/linux-file-auto-sync-directories/

    0 讨论(0)
  • 2021-01-30 07:35

    I'm using this little Ruby-Script:

    #!/usr/bin/env ruby
    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    # Rsyncs 2Folders
    #
    # watchAndSync by Mike Mitterer, 2014 <http://www.MikeMitterer.at>
    # with credit to Brett Terpstra <http://brettterpstra.com>
    # and Carlo Zottmann <https://github.com/carlo/haml-sass-file-watcher>
    # Found link on: http://brettterpstra.com/2011/03/07/watch-for-file-changes-and-refresh-your-browser-automatically/
    #
    
    trap("SIGINT") { exit }
    
    if ARGV.length < 2
      puts "Usage: #{$0} watch_folder sync_folder"
      puts "Example: #{$0} web keepInSync"
      exit
    end
    
    dev_extension = 'dev'
    filetypes = ['css','html','htm','less','js', 'dart']
    
    watch_folder = ARGV[0]
    sync_folder = ARGV[1]
    
    puts "Watching #{watch_folder} and subfolders for changes in project files..."
    puts "Syncing with #{sync_folder}..."
    
    while true do
      files = []
      filetypes.each {|type|
        files += Dir.glob( File.join( watch_folder, "**", "*.#{type}" ) )
      }
      new_hash = files.collect {|f| [ f, File.stat(f).mtime.to_i ] }
      hash ||= new_hash
      diff_hash = new_hash - hash
    
      unless diff_hash.empty?
        hash = new_hash
    
        diff_hash.each do |df|
          puts "Detected change in #{df[0]}, syncing..."
          system("rsync -avzh #{watch_folder} #{sync_folder}")
        end
      end
    
      sleep 1
    end
    

    Adapt it for your needs!

    0 讨论(0)
  • 2021-01-30 07:35

    I used to have the same setup under Windows as you, that is a local filetree (versioned) and a test environment on a remote server, which I kept mirrored in realtime with WinSCP. When I switched to Mac I had to do quite some digging before I was happy, but finally ended up using:

    • SmartSVN as my subversion client
    • Sublime Text 2 as my editor (already used it on Windows)
    • SFTP-plugin to ST2 which handles the uploading on save (sorry, can't post more than 2 links)

    I can really recommend this setup, hope it helps!

    0 讨论(0)
提交回复
热议问题