{ "info": { "author": "Adriano Di Luzio", "author_email": "adrianodl@hotmail.it", "bugtrack_url": null, "classifiers": [ "Development Status :: 6 - Mature", "Environment :: Other Environment", "Intended Audience :: Developers", "Intended Audience :: End Users/Desktop", "Intended Audience :: Information Technology", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Topic :: Internet :: File Transfer Protocol (FTP)", "Topic :: System :: Archiving :: Backup", "Topic :: System :: Archiving :: Mirroring", "Topic :: Utilities" ], "description": "# sftpclone\n\n[![PyPI version](https://img.shields.io/pypi/v/sftpclone.svg?style=flat-square)](https://pypi.python.org/pypi/sftpclone)\n![PyPI python version](https://img.shields.io/pypi/pyversions/sftpclone.svg?style=flat-square)\n[![PyPI license](https://img.shields.io/pypi/l/sftpclone.svg?style=flat-square)](LICENSE)\n\nA tool for cloning/syncing a local directory tree with an SFTP server.\n\n## Features\n\n* Keep in sync a local directory tree with a specified folder of an SFTP server.\n* Update symbolic links as needed and keep files _consistent_.\n* Automatic tilde expansion/handling on the SFTP server.\n* Public key authentication.\n* `ssh_config` entries compatibility.\n* Syncing exclusion patterns.\n* Compatible with both Python 2 and Python 3.\n\n## Install\nYou can install sftpclone by using pip:\n\n```bash\n$ pip install sftpclone --user\n```\n\n**Note**: Sometimes building required dependencies in user mode doesn't work. In that case, you'd need to use `sudo` and to remove the `--user` flag.\nAlternatively, you could make use of a virtualenv.\n\nAlternatively, you can clone this repository and then launch:\n\n```bash\n$ git clone https://github.com/unbit/sftpclone\n$ cd sftpclone\n$ python setup.py install\n```\n\nIn both cases, you'll find the sftpclone script in your path.\n\n## Usage\n\n```\nusage: sftpclone [-h] [-k private-key-path]\n [-l {CRITICAL,ERROR,WARNING,INFO,DEBUG,NOTSET}] [-p PORT]\n [-f] [-a] [-c ssh config path] [-n known_hosts path] [-d]\n [-e exclude-from-file-path] [-t] [-o]\n local-path user[:password]@hostname:remote-path\n```\n\nWhere, for each command line argument:\n\n* **local-path**: The path of the local folder. This path must exists and can contain `~` (we use tilde expansion).\n* **sftp-url**: It specifies the remote SFTP url having the form: `[user[:password]@]hostname:remote-path`. Both the password and the user field can be omitted. If you omit the former then you should specify a private key identity file. If you omit the latter then the current user is automatically used. The hostname can refer to a element of your `ssh_config` file. If the remote path contains `~`, then it will be expanded to the default folder in which the user begins her SFTP session.\n* **[h]elp**: show the help message and exit.\n* **private-[k]ey-path**: the path to your private identity file. Set it if you are not using password authentication. It automatically defaults to `~/.ssh/id_rsa` and can be used more than once.\n* **[l]ogging**: set the log level (ERROR by default).\n* **[p]ort**: SSH remote port (defaults to 22).\n* **[f]ix-symlinks**: if you have absolute symlinks pointing to your synced directory, they will remain consistent on the remote server: i.e., they will have an absolute path that reflect the path of the cloned directory on the server. Useful for cluster configurations.\n* **ssh-[a]gent**: enable ssh-agent support. Any private-[k]ey-path argument will be ignored.\n* **ssh-[c]onfig-path**: in the sftp-url's hostname you can [specify an entry of your `ssh_config` file](#ssh_config-compatibility). If you are using a non-standard path, you can set it here.\n* **k[n]own_hosts path**: path to your [`known_hosts`](#known_hosts-checking) file. Default to `~/.ssh/known_hosts`.\n* **[d]isable-known-hosts**: [disable remote fingerprint](#known_hosts-checking) check against local `known_host` file.\n* **[e]xclude-from-file-path**: the path to a file containing a list of patterns. Each file matched by these pattern [will be ignored](#exclude-list) (not synced).\n* **do-not-dele[t]e**: do not delete remote files that are missing from the local directory.\n* **all[o]w-unknown**: do not ask for confirmation before connecting to unknown hosts.\n\n**Warning**: be sure to select a __proper__ remote folder. \nThe synchronization process will indeed delete any file that doesn't exist in the local folder (unless you turn the `-t` option on).\n\n## `ssh_config` compatibility\n\nThe hostname in the sftp-url parameter can be a valid entry in a `ssh_config` file. Specifically, your entry should have relevant parameters such as:\n\n* `HostName`\n* `User`\n* `Port`\n* `IdentityFile`\n* `ProxyCommand`\n\nAny value not found will fallback to the CLI arguments. \nAnyway, you _have to set_ the `IdentityFile` field, otherwise authentication will try to fallback to `~/.ssh/id_rsa` and could not work.\nThe first hostname matching the pattern is chosen (in the `ssh_config` way).\n\n## `known_hosts` checking\n\nBy default sftpclone will match the remote host fingerprint against the one contained in your `~/.ssh/known_hosts` file.\nIf this file doesn't exists on your machine, you can specify a different path by using the `-n` option.\nFurthermore, you can disable the check with the `-d` flag.\nUnknown hosts will require the user to authorize the connection. Please note that, even after authorization, the `known_host`\nfile won't be modified.\n\n## Exclude list\n\nIt takes inspiration from the rsync/tar `--exclude-from` flag.\n\nYou can specify among your command line arguments a file containing a list of patterns, one per each line.\nAll those files that match any pattern will not be synced with the SFTP server.\n\nLines beginning with `;` or `#` are ignored.\n\nEach pattern is considered relative to the syncing directory. As a consequence, leading `/` are ignored.\n\n### Example\n\n```ini\n; This will exclude any file or directory beginning with foo\nfoo*\n; This will exclude any file foo in a subdir of the directory bar.\nbar/*/foo\n```\n\n## Programmatic usage\n\nYou can find some examples of programmatic usage inside the [examples](examples) directory.\n\n## Testing\n\nThis project uses [nose](https://nose.readthedocs.org/en/latest/) for testing.\nIn addition, on Python 2 you'll need the `mock` module (part of Python standard lib from 3.3).\nIn both cases, you can install test requirements with:\n\n```bash\n$ pip install -r test_requirements.txt\n```\n\nThen, You can launch the test suite by using, from the project root directory:\n```bash\n$ nosetests\n$ python setup.py test # alternatively\n```\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/unbit/sftpclone", "keywords": "sftpclone,sftp,sync,ftp,ssh", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "sftpclone", "package_url": "https://pypi.org/project/sftpclone/", "platform": "", "project_url": "https://pypi.org/project/sftpclone/", "project_urls": { "Homepage": "https://github.com/unbit/sftpclone" }, "release_url": "https://pypi.org/project/sftpclone/1.2.2/", "requires_dist": [ "paramiko (==2.4.1)" ], "requires_python": "", "summary": "A tool for cloning/syncing a local directory tree with an SFTP server.", "version": "1.2.2" }, "last_serial": 4233921, "releases": { "1.0": [ { "comment_text": "", "digests": { "md5": "d0823215a1944ee5aab8332a93faf3bf", "sha256": "8ffe464bd2e77929fd691ad7f2e364a119970b298dfa11f8371879be0e9e18f3" }, "downloads": -1, "filename": "sftpclone-1.0.tar.gz", "has_sig": false, "md5_digest": "d0823215a1944ee5aab8332a93faf3bf", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11525, "upload_time": "2014-11-21T15:45:53", "url": "https://files.pythonhosted.org/packages/90/6b/9873d513018183a91a479b7875c044f2de7eb59ef61d8862e0691df14cc6/sftpclone-1.0.tar.gz" } ], "1.1": [ { "comment_text": "", "digests": { "md5": "4a88a0a3446c1046915105c2ae26bb0b", "sha256": "14419253e422fca8b98de669d4a6543f1600457ac69a684bdd37656f683061e6" }, "downloads": -1, "filename": "sftpclone-1.1.tar.gz", "has_sig": false, "md5_digest": "4a88a0a3446c1046915105c2ae26bb0b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13409, "upload_time": "2015-11-12T15:25:03", "url": "https://files.pythonhosted.org/packages/7a/c1/9f30639dddd4a999c470fc4ac2f19eed997a401f8328249d299c99ccb679/sftpclone-1.1.tar.gz" } ], "1.1.1": [], "1.1.2": [ { "comment_text": "", "digests": { "md5": "179134ad2976ff082791e656d2640205", "sha256": "d9289a4285bf9dded51175320856fd81cf8c3eb7803d0bd985360f2e8029ef2a" }, "downloads": -1, "filename": "sftpclone-1.1.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "179134ad2976ff082791e656d2640205", "packagetype": "bdist_wheel", "python_version": "3.5", "requires_python": null, "size": 14945, "upload_time": "2015-12-16T14:34:54", "url": "https://files.pythonhosted.org/packages/92/5c/923206aac610fc5bf277c4299f52d65c1145243b7843b83312c268d1a326/sftpclone-1.1.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "94769e6bb57201c27325a6c981731925", "sha256": "8fd48d1b9b6ac8dc294b2797e812549993904175f49c840d1dbae30ea59641c9" }, "downloads": -1, "filename": "sftpclone-1.1.2.tar.gz", "has_sig": false, "md5_digest": "94769e6bb57201c27325a6c981731925", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15761, "upload_time": "2015-12-16T14:34:48", "url": "https://files.pythonhosted.org/packages/63/b0/8765f29745a98e571fbf62325129cc1fb24b7fedb1d69b815eb8ce12e618/sftpclone-1.1.2.tar.gz" } ], "1.2": [ { "comment_text": "", "digests": { "md5": "4ee2d1ede7c0583b3d482c1ead9b13e3", "sha256": "7d254280801c5a3444c2cd467e0db7de6ebf7f23c6afaa81f0b99021c718b98c" }, "downloads": -1, "filename": "sftpclone-1.2.tar.gz", "has_sig": false, "md5_digest": "4ee2d1ede7c0583b3d482c1ead9b13e3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16320, "upload_time": "2017-02-23T09:18:51", "url": "https://files.pythonhosted.org/packages/04/ed/8057431579538a266784bb4928123f661f696eabbe115945ab5a7173ce59/sftpclone-1.2.tar.gz" } ], "1.2.2": [ { "comment_text": "", "digests": { "md5": "3fbacda64da5340691df9ca1ca71af41", "sha256": "5f5c07605b7c1d81751cf8abe773ae7aa26bd9d5b97fb198c5307ef62797017d" }, "downloads": -1, "filename": "sftpclone-1.2.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "3fbacda64da5340691df9ca1ca71af41", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 20159, "upload_time": "2018-09-03T10:24:20", "url": "https://files.pythonhosted.org/packages/d1/02/a4a8d11dc6d9b089f5ad96cf2a1510e87a16557abbbcff99469caa9d1bd7/sftpclone-1.2.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "4a23671f12c2ad4b14f26b43c3ef16ac", "sha256": "aba5847e701f25339fe56ace26a71cc5e95aea31f5711f7a11cd6cebc7800849" }, "downloads": -1, "filename": "sftpclone-1.2.2.tar.gz", "has_sig": false, "md5_digest": "4a23671f12c2ad4b14f26b43c3ef16ac", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 22873, "upload_time": "2018-09-03T10:24:21", "url": "https://files.pythonhosted.org/packages/84/a2/1cfce5b83817f035f8f5cc7fb23bf207dda91238eace76af1026c15b0d2b/sftpclone-1.2.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "3fbacda64da5340691df9ca1ca71af41", "sha256": "5f5c07605b7c1d81751cf8abe773ae7aa26bd9d5b97fb198c5307ef62797017d" }, "downloads": -1, "filename": "sftpclone-1.2.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "3fbacda64da5340691df9ca1ca71af41", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 20159, "upload_time": "2018-09-03T10:24:20", "url": "https://files.pythonhosted.org/packages/d1/02/a4a8d11dc6d9b089f5ad96cf2a1510e87a16557abbbcff99469caa9d1bd7/sftpclone-1.2.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "4a23671f12c2ad4b14f26b43c3ef16ac", "sha256": "aba5847e701f25339fe56ace26a71cc5e95aea31f5711f7a11cd6cebc7800849" }, "downloads": -1, "filename": "sftpclone-1.2.2.tar.gz", "has_sig": false, "md5_digest": "4a23671f12c2ad4b14f26b43c3ef16ac", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 22873, "upload_time": "2018-09-03T10:24:21", "url": "https://files.pythonhosted.org/packages/84/a2/1cfce5b83817f035f8f5cc7fb23bf207dda91238eace76af1026c15b0d2b/sftpclone-1.2.2.tar.gz" } ] }