Package: rfstools
rfstoolsRemote file system tools for data manipulation between remote and local host (cp, mv, ls, rm,..) written in Python3.
This package provides you executablespcp,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 reencoding during data transfer (CRLF/LF and character reencoding).Warning: This package is still under heavy development and the API may change.ExamplesIn further subchapters, there are examples of solving some of 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 local hostFirst of all, we need to set up configuration file.cat > /some-path/rfstools.conf << EOF
connection-type=SMB12

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

host=speciserver-smb.cz
username=speciman

password=mysecret

EOFAfter that, we set up an enviroment variableRFSTOOLS_CONFIG, so the tool knows, which configuration file should it use.export RFSTOOLS_CONFIG=/some-path/rfstools.confFinally, we runpcp r:/some-path2/file ./Downloading all files from remote folder /etc ending with .confpcp r:/etc/*.conf ./Listing all subfolders in some folderpls r:/some-path/*/Recursive copying of remote folder to localpcp -r r:/folder ./Moving all remote temporary files in /tmp to local host tmppmv r:/tmp/* /tmpCross copying (using local and remote files) to remote hostpcp r:/file1 /file2 r:/target-folderDeletetion of all remote files (with directories) ending with .tmpprm -r r:/**/*.tmpCopiing greped files to local hostpls -p r:/some-path | grep "^.*/SOME_REGEX$" | xargs pcp -t /target-folderRecoding from CRLF to LF while copying from remote host to local hostexport RFSTOOLS_REMOTE_CRLF=TRUE
pcp -X r:/crlf-file ./lf-fileRecoding from local UTF8 file to UTF16 remote encoding while copyingexport RFSTOOLS_REMOTE_ENCODING=UTF16
pcp -X ./utf8-file r:/utf16-fileInstallationWe recommend, that you upgrade your pip version before doing any further step.pip3 install --user -U pip

# If there is no pip3
pip install --user -U pipBe sure, that yourpipinstallation folder/bin is correctly in yourPATHenviroment variable.
For example, if you are on Debian and you are not installing under root, you have~/.local/binin $PATH.
If it is not present, you will not able to callrfstoolsfrom command line.Packagesrfslibandrfstoolsare private and therefore it is needed, that you add extra indexes topipconfiguration.
For example this can be done by adding file.pip/pip.confwith[global]
extra-index-url = https://<token_name>:<token>@git.profinit.eu/api/v4/projects/551/packages/pypi/simple 
  https://<token_name>:<token>@git.profinit.eu/api/v4/projects/552/packages/pypi/simplewhere (token_name,token) pair might be ether personal access token to Profinit Gitlab or deploy token to Profinit Gitlab.
If you want to generate personal access token, you can do it here:https://git.profinit.eu/-/profile/personal_access_tokensIf you want to generate deploy token, you can do it here:https://git.profinit.eu/groups/rfs/-/settings/repositoryBe aware, that if private pypi repository on Gitlab doesn't work correctly, the useless dummy public version of this package (squatting-attack prevension) might be downloaded.Finally, install the package usingpippip install rfstoolsUpgradeIf you installed this utility using the manual above, you should be able to easily upgrade rfstools and rfslib to the current version usingpip install -U rfstools rfslibConfigurationArgs that start with '--' (eg. -U) can also 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 athttps://goo.gl/R74nmi). If an arg is specified in more than one place, then
commandline values override environment variables which override config file
values which override defaults.DocumentationDocumentation can be found in autogenerated repositoryrfstools-docs.