Recursive copy to and remove from an SMB share utilizing parallel connections
- Linux
mount.cifs
installedstack
installed~/.local/bin/
in your$PATH
- Clone this repo and
cd
into it stack setup
(required once before building)stack install
to buildparcp
andparrm
and copy them to~/.local/bin/
- These programs work via setuid:
for cmd in 'chown root:root' 'chmod a+s'; do
sudo $cmd ~/.local/bin/{parcp,parrm}
done
$ parcp --help
Recursive copy in parallel
Usage: parcp [-v|--verbose] [--debug] [-t|--threads INT]
(-n|--share-name //HOST/SHARE) (-c|--credentials FILENAME) SOURCE
DESTINATION
Available options:
-h,--help Show this help text
-v,--verbose Print every file operation
--debug Print lots of debug info
-t,--threads INT How many parallel connections to
establish (default: 4)
-n,--share-name //HOST/SHARE
The UNC name of the SMB share
-c,--credentials FILENAME
The credentials file to pass to mount.cifs(8)
SOURCE Directory to copy contents from
DESTINATION Directory to copy contents to
$ parrm --help
Recursive delete in parallel
Usage: parrm [-v|--verbose] [--debug] [-t|--threads INT]
(-n|--share-name //HOST/SHARE) (-c|--credentials FILENAME) TARGET
Available options:
-h,--help Show this help text
-v,--verbose Print every file operation
--debug Print lots of debug info
-t,--threads INT How many parallel connections to
establish (default: 4)
-n,--share-name //HOST/SHARE
The UNC name of the SMB share
-c,--credentials FILENAME
The credentials file to pass to mount.cifs(8)
TARGET Directory to remove