Code Monkey home page Code Monkey logo

sublime-rsync-ssh's Introduction

Sublime Rsync SSH

Keep remote directories in sync with local project folders.

Description

This plugin will let you sync your project folders to one or more remote servers using rsync and ssh.

Terminology

  • A remote is a local project folder configured for sync.
  • A destination is a path on specific server as a specific user.
  • A remote can have one or more destinations

Features

  • Edit locally, work remotely
  • Upload one or more project folders to one or more remote servers.
  • Each project folder can have multiple remotes, and each remote can have multiple destinations
  • Sync whole project or just a single remote or destination
  • Single file save only syncs the file being saved.
  • Auto generate initial rsync-ssh configuration for all folders in a project.
  • Exclude files, either for the whole project, a single fold or just a single remote.
  • Selective sync: Only sync part of a project folder to remote server.
  • Hooks for running a command on the remote host before and after sync.
  • Enable/Disable remotes.
  • Parse arguments to rsync for advanced usage (or features not yet included)
  • Detailed console output so you know what gets synced where.

Requirements

  • You must have both ssh and rsync installed, both locally and on the remote server.
  • You must have a ssh-key that allows you to perform login without password. If you have a password on your key, then you must use ssh-agent. On OS X you'll need to add your keys to the Keychain by using ssh-add -K, once this is done OS X will use ssh-agent to query the Keychain for your password.
  • On the remote server, you must add your ssh public key to ~/.ssh/authorized_keys.

For more info on creating and using ssh keys please see this nice guide.

Usage

Note you can see everything this plugin does by viewing its output on the console.

Initialize configuration

First create a Sublime Project, you do this by adding one or more folders and then saving your project.

Then you go to the Project menu and select Rsync SSH and then Initialize Settings, this will add the rsync_ssh block to settings with some reasonable defaults and then open the preferences for you to edit.

Be aware that the --delete option will destroy the directory you speficy in remote_path - as a courtesy I've added --dry-run so you can test your config before running rsync for real.

Example .sublime-project file

Note that the .sublime-project is a JSON file, and as such comments are not supported, fortunately for us Sublime Text uses a a rather lax parser that supports // comments. The comments below have just been added to document the individual sections .

When you initialize your project via Initialize Settings the plugin will add the rsync_ssh config to your project file.

{
    "folders":
    [
        {
            "follow_symlinks": true,
            "path": "my-project-folder"
        }
    ],
    "settings":
    {
        // This is the block the plugin adds to your project file
        "rsync_ssh":
        {
            // To use non-standard ssh specify the path here ...
            "ssh_binary": "/usr/local/bin/ssh",
            // ... and additional arguments here
            "ssh_args": ["-F", "~/another/config/file"],

            // To disable sync on save set 'sync_on_save' to false
            "sync_on_save": true,

            // To always sync all files when saving (not just the saved file)
            // set `sync_all_on_save` to true
            "sync_all_on_save": true,

            // Rsync options
            "options":
            [
                "--dry-run",
                "--delete",
                // Override how we handle permissions, useful for platforms that does not support Unix permissions.
                // Here we tell rsync to use the umask on the destination to set the permissions
                "--no-perms", "--chmod=ugo=rwX"
            ],
            // Stuff we do not want rsync to copy
            "excludes":
            [
                ".git*",
                "_build",
                "blib",
                "Build"
            ],
            // Servers we want to sync to
            "remotes":
            {
                // Each folder from the project will be added here
                "my-project-folder":
                [
                    {
                        // You can disable any destination by setting this value to 0
                        "enabled": 1,
                        // Stuff we do not want rsync to copy, but just for this destination
                        "excludes":
                        [
                        ],
                        // ssh options
                        "remote_host": "my-server.my-domain.tld",
                        "remote_path": "/home/you/Projects/my-project",
                        "remote_port": 22,
                        "remote_user": "you",
                        // Run commands before and after rsync
                        "remote_pre_command": "",
                        "remote_post_command": ""
                    }
                ],
                // Syncing a single subfolder is also supported
                "my-project-folder/subfolder":
                [
                    {
                        // You can disable any destination by setting this value to 0
                        "enabled": 0,
                        // Stuff we do not want rsync to copy, but just for this destination
                        "excludes":
                        [
                        ],
                        // ssh options
                        "remote_host": "my-server.my-domain.tld",
                        "remote_path": "/home/you/Projects/my-subfolder-target",
                        "remote_port": 22,
                        "remote_user": "you",
                        // Run commands before and after rsync
                        "remote_pre_command": "",
                        "remote_post_command": ""
                    }
                ]
            }
        }
    }
}

Sync single file

Just save the file normally, as this will trigger a save event which makes this plugin sync the file to all enabled remotes.

Sync specific remote or destination

Press ⌘⇧F11 to select a specific remote or destination to sync. When selecting a specific destination the enabled flag is overridden and the folder will always be synced. If you select a remote, and then select the All destination, then the enabled flag will be respected. If you select a remote with just one destination sync will started immediately and the enabled flag will be overridden.

Sync full project

Press ⌘⇧F12 to sync all folders to all enabled remotes. - Note you must do this at least once in order to create the project folder on the remote servers.

Installation

You install this plugin either by cloning this project directly, or by installing it via the excellent Package Control plugin. Press ⌘⇧P and type Package Control: Install Package and select it, then type the package name rsync-ssh and select it.

To use this plugin on Windows you must install Cygwin first.

F.A.Q.

When I try to sync, nothing happens

You probably forgot to remove --dry-run from the rsync options in the project configuration file.

I'm on Windows, how do I get sane permissions on the destination

As Windows doesn't have native support for Unix permissions, you can't rely on the default sync mode of "preserve permissions". Instead you can turn off the persission sync with --no-perms and then use --chmod=ugo=rwX to make rsync use the umask on the destination to determine which permissions a file should have. When you initialize the rsync-ssh configuration this will be automatically added to the configuration as shown in the example above.

TODO

  • Rename remotes to folders (Calling them remotes is kinda silly).

License

© 2013-2015 David Olrik <[email protected]>.

This is free software. It is licensed under the Creative Commons Attribution-ShareAlike 3.0 Unported License. Feel free to use this package in your own work. However, if you modify and/or redistribute it, please attribute me in some way, and distribute your work under this or a similar license.

sublime-rsync-ssh's People

Contributors

aviddiviner avatar cklein avatar ctheune avatar davidolrik avatar elifiner avatar gbisheimer avatar lboynton avatar rcopera avatar shapiromatron avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

sublime-rsync-ssh's Issues

Initialize Settings error retrieving USER

Using ST3 Build 3059 on Windows 8.

Traceback (most recent call last):
  File "D:\Archivos de programa\Sublime Text 3\sublime_plugin.py", line 549, in run_
    return self.run(edit)
  File "C:\Users\Guillermo\AppData\Roaming\Sublime Text 3\Packages\sublime-rsync-ssh\rsync-ssh.py", line 38, in run
    "remote_path": "/home/" + os.environ['USER'] + "/Projects/" + os.path.basename(folder.get("path")),
  File "X/os.py", line 669, in __getitem__
KeyError: 'USER'

ERROR: Unable to locate rsync

Hi, for some reason it doesn't work when using a debian squeeze remote.
When saving here what the console tells :

[rsync-ssh] obstinato.fr[v2]: ERROR: Unable to locate rsync on my.domain
[rsync-ssh] obstinato.fr[v2]: rsync est /usr/bin/rsync
[rsync-ssh] obstinato.fr[v2]: 

Does not properly handle spaces in folder names or file names

I haven't spent any time looking into the code, but I have noticed that when I have spaces in my folder names, the content is sent to a container folder up in the hierarchy tree and not to the specific file.

So for example, if we had:
"ALongPath/With/Some Path/To a File.txt"

The contents of "To a File.txt" would show up on the remote system as:
"ALongPath/With/Some"

Origin path error

Suddently, rsync has stopped working. It seems that there is a misconception of the host path. Here my conf:

{
    "folders":
    [
        {
            "follow_symlinks": true,
            "path": "/home/ben/Scrivania/qboxmail_panel-PROD"
        }
    ],
    "settings":
    {
        "rsync_ssh":
        {
            "excludes":
            [
            ],
            "options":
            [
            ],
            "remotes":
            {
                "qboxmail_panel-PROD":
                [
                    {
                        "enabled": 1,
                        "excludes":
                        [
                         "tmp/",
                         "log/"
                        ],
                        "options":
                        [
                        ],
                        "remote_host": "***",
                        "remote_path": "/var/www/cbsolt/qboxmail_panel-PROD",
                        "remote_port": 22,
                        "remote_post_command": "",
                        "remote_pre_command": "",
                        "remote_user": "***"
                    }
                ]
            },
            "sync_on_save": true
        }
    }
}

It ha salways worked, but today, it doesn't work. I have opened the shell, and here is the command that create:

rsync -v -zar -e ssh -q -T -p 22 -o ConnectTimeout=10 /home/ben/Scrivania/qboxmail_panel-PROD/qboxmail_panel-PROD/ [email protected]:/var/www/cbsolt/qboxmail_panel-PROD --exclude=.DS_Store --exclude=log/ --exclude=tmp/

As you can see, the folder qboxmail_panel-PROD is ducplicated in the url. But the pwd of the file is this:

/home/ben/Scrivania/qboxmail_panel-PROD

add 'q' switch to ssh?

My work server has something like an MOTD that is outputted to the terminal, even for non-interactive ssh sessions (ugh). I don't exactly know where/how the message is coming from but I know that .hushlogin doesn't suppress it and that it trips up rsync-ssh's sanity check for ssh and rsync. Specifically the re.match method sees the welcome message instead of rysinc is .... Adding -q to the ssh command (in check_command) corrects the problem.

This might just be something I need to take up with my sysadmin, but as an alternative perhaps you could let the user add options to the ssh command if not just hardcoding in the q switch.

need to set default encoding for output of subprocess

There's error when check output of subprocess in Chinese language & Mac OS.

Exception in thread Thread-33:
Traceback (most recent call last):
  File "./python3.3/threading.py", line 901, in _bootstrap_inner
  File "/Users/faywong/Library/Application Support/Sublime Text 3/Installed Packages/Rsync SSH.sublime-package/rsync_ssh.py", line 567, in run
    output = check_output(rsync_command, stderr=subprocess.STDOUT)
  File "/Users/faywong/Library/Application Support/Sublime Text 3/Installed Packages/Rsync SSH.sublime-package/rsync_ssh.py", line 43, in check_output
    return subprocess.check_output(*args, universal_newlines=True, startupinfo=startupinfo, **kwargs)
  File "./python3.3/subprocess.py", line 578, in check_output
  File "./python3.3/subprocess.py", line 907, in communicate
  File "./python3.3/subprocess.py", line 479, in _eintr_retry_call
  File "./python3.3/encodings/ascii.py", line 26, in decode
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe6 in position 50: ordinal not in range(128)

May be

import sys

reload(sys)

sys.setdefaultencoding(‘utf8′)

helps.

gulp updates hook?

Is there an easy way to update gulp so that it triggers something for this plugin to sync? Right now I have to wait for gulp to finish and then perform a manual sync which usually take a few seconds longer than the regular sync.

Allow sync in both directions

It would be useful to allow rsync back to the local directory on a hotkey or command. My current workflow allows me to edit locally, but all of the git information is stored on the remote machine so if I were to rebase/merge I can't get those changes locally unless I rsync the project manually.

This is a great plugin, btw.

Sync subfolders

Hi,
at first thx, finally a working sync plugin, i was waiting for this a long time. :)

Anyway, it would be nice if a single subfolder could be synced like this:

source:
/folder/a/b/

target:
/target/b/

I have multiple folders in my project but i don't want to sync each root folder, just subsets of the child folders.

Project settings example:

"folders":
[
    {
        "path": "/folder/a"
    }
]

"remotes":
        {
            "/folder/a/b":
            [
                {
                    "enabled": 1,
                    "remote_host": "localhost",
                    "remote_path": "/target/b",
                }
            ],

[rsync-ssh] my-project: No remotes defined for my-project

I have no doubt that this is a me issue rather than a plugin issue, but I think I have everything configured properly and yet I see that message in my console when I save something or try to do a complete upload. My project settings file (my-project.sublime-project) contains the following:

{
    "folders":
    [
        {
            "path": "/Users/robwilkerson/Developer/www/my-project"
        }
    ],
    "settings":
    {
        "rsync_ssh":
        {
            "excludes":
            [
                ".git*",
                "_build",
                "blib",
                "Build"
            ],
            "options":
            [
                "--dry-run",
        "--links",
                "--delete"
            ],
            "remotes":
            {
                "/Users/robwilkerson/Developer/www/my-project":
                [
                    {
                        "enabled": 1,
                        "excludes":
                        [
                        ],
                        "options":
                        [
                        ],
                        "remote_host": "my.devserver.net",
                        "remote_path": "/home/robwilkerson/my-project",
                        "remote_port": 22,
                        "remote_post_command": "",
                        "remote_pre_command": "",
                        "remote_user": "robwilkerson"
                    }
                ]
            }
        }
    }
}

What am I missing here?

Thanks.

Destination folders of similar name cause multiple uploads

Hello,
I've stumbled over a problem where the plugin will sync with multiple destinations though only one was selected. It should be reproducible with a config of this kind:

"remotes":
{
    "project":
    [
        {
            "enabled": 1,
            "excludes":
            [
            ],
            "options":
            [
            ],
            "remote_host": "127.0.0.1",
            "remote_path": "/srv/dev",
            "remote_port": 22,
            "remote_post_command": "",
            "remote_pre_command": "",
            "remote_user": ""
        },
        {
            "enabled": 1,
            "excludes":
            [
            ],
            "options":
            [
            ],
            "remote_host": "127.0.0.1",
            "remote_path": "/srv/dev_test",
            "remote_port": 22,
            "remote_post_command": "",
            "remote_pre_command": "",
            "remote_user": ""
        }
    ],
}

The problem is that syncing to /srv/dev will do that but also sync with /srv/dev_test which is not what I want. I've looked into it and the plugin uses string inclusion logic to do file system checks and tries to retrace the user choice also by passing strings instead of the actual choice.

I've forked and fixed it on my side by rewriting RsyncSSH. It's the version I'm using right now, so there are some changes by now:

  • the above setup works
  • can sync single file
  • can sync selection via side bar context menu (little strange caused by sublime limiting the menu based on the selected type)
  • not using sync_on_save so didn't touch it

Maybe this affects somebody else and my logic works for you to. My fork

AttributeError: 'NoneType' object has no attribute 'keys'

Writing file /project-path/app.php with encoding UTF-8 (atomic)
Exception in thread Thread-13:
Traceback (most recent call last):
File "./threading.py", line 901, in _bootstrap_inner
File "rsync-ssh in ~/Library/Application Support/Sublime Text 3/Installed Packages/Rsync SSH.sublime-package", line 151, in run
AttributeError: 'NoneType' object has no attribute 'keys'

my os is
10.10.2
Sublime Text 3065

Can't initialize settings

Hi.
I tried to init a couple of times settings in my project folder.
Nothing happened, then I opened the console and see this:

Traceback (most recent call last):
  File "/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 818, in run_
    return self.run(edit)
  File "rsync_ssh in /Users/alex.buznik/Library/Application Support/Sublime Text 3/Installed Packages/Rsync SSH.sublime-package", line 124, in run
AttributeError: 'NoneType' object has no attribute 'run_command'
[rsync-ssh] rsync_ssh configuration already exists.

No new files were created though.

What could be the problem?

OS X 10.13.2, ST 3.0

Aborting! - rsync ssh is not configured!

I've getting this error when trying to sync the whole project (⇧⌘F12):
[rsync-ssh] Aborting! - rsync ssh is not configured!

site.sublime-project

{
    "folders": [
        {
            "follow_symlinks": true,
            "path": "."
        }
    ],
    "settings": {
        "rsync_ssh": {
            "excludes": [
                ".git*",
            ],
            "options": [
                "--delete"
            ],
            "remotes": {
                "site": [
                    {
                        "enabled": 1,
                        "excludes": [],
                        "options": [],
                        "remote_host": "example.com",
                        "remote_path": "/path/to/remote",
                        "remote_port": 22,
                        "remote_post_command": "",
                        "remote_pre_command": "",
                        "remote_user": "matt"
                    }
                ]
            },
            "sync_on_save": true
        }
    }
}

(I've anonymized the project.)

How to use rsync in Windows ?

Hello,
Is it possible to use rsync in Windows ?
I read Dropbox is using rsync for synchronization of files. How to sync folders if source is Windows OS and destination is Linux server ?
or if both source and destinations are Windows OS ?
Please help me.

Package doesn't show up in Package Control

Would love to install via package control in sublime text 3 but searching both rsync-ssh and Rsync SSH doesn't yield any results. Only package that does show up is a year old or so rsync package by a different author.

Custom SSH parameters

I am working in an environment where I rely on different (auto-generated) SSH config files

I can add the custom SSH parameters via

"options": [ "--rsh='ssh -F /Path/To/My/ssh_config_dev'", ],

However, this causes the check command to fail:

[rsync-ssh] container[fc.directory]:        ssh -q -T -o ConnectTimeout=10 ctheune@container LANG=C which rsync

I think I can work around this for a while by using a custom SSH command, but that's hacky. I'm happy to contribute a patch with an option for custom SSH parameters (and then make that create the --rsh option as well.

Auto syncing as watcher feature

Hi,
at first of all thanks for this awesome plugin for SublimeText :)

Do you think there is a possibility to make syncing automatically?
Just like "auto_sync": true in config json for example?

FileNotFoundError: [WinError 2] The system cannot find the file specified

Hi. Everything was working properly on linux. Now on Windows I get this errors:
Here's the full console output on a fresh run:

Traceback (most recent call last):
  File "./threading.py", line 901, in _bootstrap_inner
  File "rsync_ssh in D:\Program Files\Sublime Text 3\Data\Installed Packages\Rsync SSH.sublime-package", line 460, in run
  File "rsync_ssh in D:\Program Files\Sublime Text 3\Data\Installed Packages\Rsync SSH.sublime-package", line 43, in check_output
  File "./subprocess.py", line 576, in check_output
  File "./subprocess.py", line 824, in __init__
  File "./subprocess.py", line 1118, in _execute_child
FileNotFoundError: [WinError 2] The system cannot find the file specified

ssh option of rsync command should be quoted

I have trouble with following rsync command, which was generated by your plugin:

rsync -v -zar -e ssh -q -T -p 22 -o ConnectTimeout=10 --dry-run --delete /Users/~/index.html ubuntu@~/index.html --exclude=.DS_Store --exclude=.ropeproject --exclude=.*.swp --exclude=.git

which should be fixed like this:

rsync -v -zar -e "ssh -q -T -p 22 -o ConnectTimeout=10" --dry-run --delete /Users/~/index.html ubuntu@~/index.html --exclude=.DS_Store --exclude=.ropeproject --exclude=.*.swp --exclude=.git

Please refer following SO:

http://stackoverflow.com/questions/18270512/rsync-and-ssh-on-android-no-such-file-or-directory

Confused

Sorry about bad summary but I'm just confused after trying this plugin. :)

  • Documentation talks about 'Initialize Settings' menu option which doesn't seem to exist.
  • "Example .sublime-project file" section has syntax errors in the example code
  • Bundled RSync.sublime-settings file has a lot of options that don't seem to match those in exmaple project file. Like for example strsync.local_path which seems equivalent to path defined in "remotes" section of the example project file, but seems it is still required for plugin to operate (judging from the code which checks for 'local_path' pref).

So basically it seems to be quite broken on first sight, for someone who doesn't go beyond documentation. Are these actual bugs or I'm missing something?

Connection unexpectedly closed (12)

I know this is a support issue, but figure it might be the best place to ask.

Began my attempts at setting this up today, on Windows 10. I'm not using Cygwin, but rsync is available on my machine. I am able to ssh into my server via a key, but rsync fails with the following:

[rsync-ssh] server[project]: rsync -v -zar -e ssh -q -T -o ConnectTimeout=10 -p YY --no-perms --chmod=ugo=rwX /d/var/remote/project/ user@server:'/var/props/workbench' --exclude=.git* --exclude=Build --exclude=_build --exclude=.DS_Store --exclude=blib
[rsync-ssh] server[project]: ERROR: rsync: connection unexpectedly closed (0 bytes received so far) [sender]
[rsync-ssh] server[project]: rsync error: error in rsync protocol data stream (code 12) at io.c(226) [sender=3.1.2]

At first I figured it was a firewall thing, but that can't be right as I can actually ssh in. Rsync is running as a service on the server as well, if that makes any difference... Could it perhaps be an rsync thing? Maybe the two rsyncs are not compatible with one another?

Exclude seems to not work

With these settings:

{
    "folders":
    [
        {
            "follow_symlinks": true,
            "path": "/Applications/AMPPS/www/aaa/bbb"
        }
    ],
    "settings":
    {
        "rsync_ssh":
        {
            "excludes":
            [
                "log/",
                "tmp/"
            ],
            "options":
            [

            ],
            "remotes":
            {
                "/Applications/AMPPS/www/aaa/bbb":
                [
                    {
                        "enabled": 1,
                        "excludes":
                        [ 

                        ],
                        "options":
                        [
                        ],
                        "remote_host": "109.168.113.241",
                        "remote_path": "/var/www/aaa/bbb",
                        "remote_port": 22,
                        "remote_post_command": "",
                        "remote_pre_command": "",
                        "remote_user": "ben"
                    }
                ]
            },
            "sync_on_save": true
        }
    }
}

I have this output. It seems to ignore my excludes!

rsync -v -zar -e ssh -q -p 22 -o ConnectTimeout=10 /Applications/AMPPS/www/aaa/bbb/ [email protected]:/var/www/aaa/bbb

Decoding output of remote_post_command sometimes fails

I have the remote_post_command defined and set to make and the plugin sometimes fails to parse the output of my make command with the following exception:

Exception in thread Thread-8:
Traceback (most recent call last):
  File "./threading.py", line 901, in _bootstrap_inner
  File "rsync_ssh in /Users/ay/Library/Application Support/Sublime Text 3/Installed Packages/Rsync SSH.sublime-package", line 581, in run
  File "rsync_ssh in /Users/ay/Library/Application Support/Sublime Text 3/Installed Packages/Rsync SSH.sublime-package", line 43, in check_output
  File "./subprocess.py", line 578, in check_output
  File "./subprocess.py", line 915, in communicate
  File "./subprocess.py", line 479, in _eintr_retry_call
  File "./encodings/ascii.py", line 26, in decode
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 117: ordinal not in range(128)

UPD
In fact this is easily reproducible by setting the remote_post_command to this: echo '‘'

Default settings doesnt work (No remotes defined for XXX)

Hi!

First time tester.

To help you debug, here is my info:

>>> sublime.active_window().folders()
['/Users/Einar/Dropbox/Projects/coretrek/loftet']
>>> os.path.basename('/Users/Einar/Dropbox/Projects/coretrek/loftet')
'loftet'
>>> sublime.active_window().active_view().settings().get("rsync_ssh").get("remotes")
{'.': [{'remote_port': 22, 'enabled': 1, 'remote_host': 'xxx', 'excludes': [], 'remote_post_command': '', 'remote_path': '/home/projects/xxx/.', 'remote_user': 'xxx', 'options': [], 'remote_pre_command': ''}]}

My sublime-project: https://gist.github.com/eigan/dc1ba5ed55bbda9fb2d9

Issue fixed when I renamed my remotes in settings to "loftet", from the default value "."
Error is at rsync-ssh.py:122 or something.

Add indication that syncing have started

It would be sweet if I could see that that sync have started, instead of waiting for notification that the sync completed / failed.

I have seen other plugin use view.set_status(). I think using this for both sync start and done would be nice.

Nothing happens after initialization

Hi.
Thank you for this great plugin.
I started it using a lot on my work machine.

At home though nothing happens after initialization - I set the correct host/path/user etc., but the Sync from Remotes line does not appear in Project>RSync SSH, not in the context menu over the root folder.
Nothing strange in the console either.

What should I look for?

ssh parameters should fall back to ssh defaults not to plugin defaults

With the current setup it is not possible to leave out ssh parameters and fall back to what is configured within .ssh/config. It would be better not to enforce that (e.g. setting -p 22 when remote_port is unset) but falling back to what is configured in .ssh/config (so simply omit the parameters from the rsync call that are unset). That way the {my}.sublime-project could be shared between users and put under revision control. E.g.

.ssh/config (user foo):

Host remotedev.example.com
    HostName foo-dev.example.com
    User foo
    Port 12345
    IdentityFile ~/.ssh/dev-foo.example.id

.ssh/config (user bar):

Host remotedev.example.com
    HostName bar-dev.example.com
    User bar
    Port 54321
    IdentityFile ~/.ssh/dev-bar.example.id

{my}.sublime-project:

"remotes": {
  "/my/projectpath": [
    {
      "enabled": 1,
      "excludes":   [],
      "options": [],
      "remote_host": "remotedev.example.com",
      "remote_path": "/my/projectpath/api"
    }
  ]
}

Missing newline when host is disabled

Hello, this is no major issue but rather a minor tweak (I hope).
I noticed when all my hosts are disabled that the message being sent to the console is missing a newline:
screenshot - 150715 - 15 07 56

"sync_on_save" not work

Hello,

"sync_on_save" does not work if there are more than one remotes in the same project.

Regards,
Alan

Error when syncing folder with repeating name

I'm getting the following error when I try to sync a folder that has it's name repeated in the path:

Traceback (most recent call last):
  File "./threading.py", line 901, in _bootstrap_inner
  File "/Users/david.dovel/Library/Application Support/Sublime Text 3/Packages/sublime-rsync-ssh/rsync-ssh.py", line 165, in run
    [split_prefix, subfolder] = str.split(remote_key, folder_path_basename, 2)
ValueError: too many values to unpack (expected 2)

syncing /Developer/vagrant-proj1/projects/proj1 causes this issue
syncing /Developer/vagrant-proj1/projects/proj2 does not

Installation ?

Using Package Control....
what's the plugin name, can't find it.

Thx ;)

sublime-rsync-ssh feature suggestion to allow sublime-project configuration to define ssh private key path

Hello, I found your project to be perfect for my goal of using rsync and sublime text instead of ftp.

I'm trying to use this plugin on windows to connect to linux and I couldn't figure out a configuration that works for key authentication using cygwin. I did get it working without a password being required, so I know there wasn't anything failing except ssh authentication. I assume this is easier on a mac or linux machine where ssh is native. It seems like a pain to have to deal with cygwin since ssh-agent doesn't seem to work or I lack the knowledge after trying a few things. I looked into modifying your plugin to add the ssh key path argument to the rsync / ssh command and found that to be an easier solution.

I suggest adding a feature to the open source project to make it easier for others to set their ssh private key path in the sublime-project file like this:

in sublime-project settings:
after "remote_port": 2222,

add:
"ssh_key_path":"/absolute/path/to/private_key",

and then in rsync_ssh.py after this line:
if self.destination.get("remote_port"):
ssh_command.extend(["-p", str(self.destination.get("remote_port"))])
add this:
if self.destination.get("ssh_key_path"):
ssh_command.extend(["-i", str(self.destination.get("ssh_key_path"))])

This worked for me, and this lets me use a simple setup for cygwin on windows.

Or if you know a better way, perhaps provide some docs for it since authentication is the one thing lacking in the current readme.

Thanks for making this plugin and good job with the docs and feature set so far!

Error Initialize Settings

Traceback (most recent call last):
File "/opt/sublime_text/sublime_plugin.py", line 549, in run_
return self.run(edit)
File "rsync-ssh in /home/oleg/.config/sublime-text-3/Installed Packages/Rsync SSH.sublime-package", line 35, in run
TypeError: 'NoneType' object is not iterable

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.