Skip to main content

rfstools

Remote file system tools for data manipulation between remote and local host (cp, mv, ls, rm,..) written in Python3. This package provides you executables pcp, pls, pmv,..., which enables you to do painless data operations on remote/between remote and local host using SFTP/FTP/FTPS/SMB12(SMB version 1 or 2)/SMB23(SMB version 2 or 3)/FS(local file system) protocols.

Furthermore, you can enable data re-encoding during data transfer (CRLF/LF and character re-encoding).

Installation

The rfstools tool can be installed using pip from the PyPI public registry.

pip install rfstools

Documentation

The documentation can be found in autogenerated repository rfstools-docs.

Configuration

Arguments can be passed to rfstools commands in multiple ways - configuration file, environment variable, and standard command line argument.

If an argument is specified in more than one place, then the command line argument overrides the environment variable which overrides the config file value which overrides the default value.

Arguments that start with '--' can be set in a config file - /etc/rfstools.conf or ~/.rfstools.conf or specified via -c. Config file syntax allows: key=value, flag=true, stuff=[a,b,c] (for details, see syntax at https://goo.gl/R74nmi).

Details about concrete commands can be found in rfstools-docs/commands.

Examples

In further subchapters, there are examples of solving some of the basic tasks using this tool. Only the first chapter contains the configuration file setup...in the others, it can be done analogically.

Copy a file from a SMB2 server to the local host

First of all, we need to set up the configuration file.

cat > /some-path/rfstools.conf << EOF
connection-type=SMB12

# For SMB we always need to say, which remote folder we use.
service-name=special-folder

host=speciserver-smb.cz
username=speciman

password=mysecret

EOF

After that, we set up an environment variable RFSTOOLS_CONFIG, so the tool knows, which configuration file should it use.

export RFSTOOLS_CONFIG=/some-path/rfstools.conf

Finally, we run

pcp r:/some-path2/file ./

Downloading all files from remote folder /etc ending with .conf

pcp r:/etc/*.conf ./

Listing all subfolders in some folder

pls r:/some-path/*/

Recursive copying of remote folder to local

pcp -r r:/folder ./

Moving all remote temporary files in /tmp to local host tmp

pmv r:/tmp/* /tmp

Cross-copying (using local and remote files) to the remote host

pcp r:/file1 /file2 r:/target-folder

Deletion of all remote files (with directories) ending with .tmp

prm -r r:/**/*.tmp

Copying greped files to the local host

pls -p r:/some-path | grep "^.*/SOME_REGEX$" | xargs pcp -t /target-folder 

Recoding from CRLF to LF while copying from remote host to local host

export RFSTOOLS_REMOTE_CRLF=TRUE
pcp -X r:/crlf-file ./lf-file

Recoding from local UTF8 file to UTF16 remote encoding while copying

export RFSTOOLS_REMOTE_ENCODING=UTF16
pcp -X ./utf8-file r:/utf16-file

Metadata

Release files for rfstools 1.8.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for rfstools 1.8.3
File Size Uploaded Provenance Actions
rfstools-1.8.3.tar.gz 44.4 kB Without provenance Details for rfstools-1.8.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for rfstools 1.8.3
File Interpreter ABI Platform Actions
rfstools-1.8.3-py3-none-any.whl Python 3 none any Details for rfstools-1.8.3-py3-none-any.whl

Total release size: 88.2 kB

Release files / rfstools-1.8.3.tar.gz

Download URL rfstools-1.8.3.tar.gz
Size 44.4 kB
Tags Source
SHA-256 checksum
How to use checksums
a42fd2332673e7db30b6fe0b9d0db327b2995cbe8d2221acb7ef675aec634a2a
BLAKE2b-256 checksum
How to use checksums
fa93a2d281a505cdee01e1b2fff87e5e83671e346b8f38b1bc12b6c213993fd3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.11.8

Release files / rfstools-1.8.3-py3-none-any.whl

Download URL rfstools-1.8.3-py3-none-any.whl
Size 43.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b82aebb709d633d702105b7cf8cf855daeea4b9ccc510f6df0554238860ca991
BLAKE2b-256 checksum
How to use checksums
d603193f5809c904ce666add99a23770fd8b522ee784df0e5a4562eda92f8229
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.11.8

Security for rfstools 1.8.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page