
Security News
Vite Releases Technical Preview of Rolldown-Vite, a Rust-Based Bundler
Vite releases Rolldown-Vite, a Rust-based bundler preview offering faster builds and lower memory usage as a drop-in replacement for Vite.
A tool for cloning/syncing a local directory tree with an SFTP server.
ssh_config
entries compatibility.You can install sftpclone by using pip:
$ pip install sftpclone --user
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.
Alternatively, you could make use of a virtualenv.
Alternatively, you can clone this repository and then launch:
$ git clone https://github.com/unbit/sftpclone
$ cd sftpclone
$ python setup.py install
In both cases, you'll find the sftpclone script in your path.
usage: sftpclone [-h] [-k private-key-path]
[-l {CRITICAL,ERROR,WARNING,INFO,DEBUG,NOTSET}] [-p PORT]
[-f] [-a] [-c ssh config path] [-n known_hosts path] [-d]
[-e exclude-from-file-path] [-t] [-o]
local-path user[:password]@hostname:remote-path
Where, for each command line argument:
~
(we use tilde expansion).[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.~/.ssh/id_rsa
and can be used more than once.ssh_config
file. If you are using a non-standard path, you can set it here.known_hosts
file. Default to ~/.ssh/known_hosts
.known_host
file.Warning: be sure to select a proper remote folder.
The synchronization process will indeed delete any file that doesn't exist in the local folder (unless you turn the -t
option on).
ssh_config
compatibilityThe 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:
HostName
User
Port
IdentityFile
ProxyCommand
Any value not found will fallback to the CLI arguments.
Anyway, you have to set the IdentityFile
field, otherwise authentication will try to fallback to ~/.ssh/id_rsa
and could not work.
The first hostname matching the pattern is chosen (in the ssh_config
way).
known_hosts
checkingBy default sftpclone will match the remote host fingerprint against the one contained in your ~/.ssh/known_hosts
file.
If this file doesn't exists on your machine, you can specify a different path by using the -n
option.
Furthermore, you can disable the check with the -d
flag.
Unknown hosts will require the user to authorize the connection. Please note that, even after authorization, the known_host
file won't be modified.
It takes inspiration from the rsync/tar --exclude-from
flag.
You can specify among your command line arguments a file containing a list of patterns, one per each line. All those files that match any pattern will not be synced with the SFTP server.
Lines beginning with ;
or #
are ignored.
Each pattern is considered relative to the syncing directory. As a consequence, leading /
are ignored.
; This will exclude any file or directory beginning with foo
foo*
; This will exclude any file foo in a subdir of the directory bar.
bar/*/foo
You can find some examples of programmatic usage inside the examples directory.
This project uses nose for testing.
In addition, on Python 2 you'll need the mock
module (part of Python standard lib from 3.3).
In both cases, you can install test requirements with:
$ pip install -r test_requirements.txt
Then, You can launch the test suite by using, from the project root directory:
$ nosetests
$ python setup.py test # alternatively
FAQs
A tool for cloning/syncing a local directory tree with an SFTP server.
We found that sftpclone demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Vite releases Rolldown-Vite, a Rust-based bundler preview offering faster builds and lower memory usage as a drop-in replacement for Vite.
Research
Security News
A malicious npm typosquat uses remote commands to silently delete entire project directories after a single mistyped install.
Research
Security News
Malicious PyPI package semantic-types steals Solana private keys via transitive dependency installs using monkey patching and blockchain exfiltration.