Contextmanager to implement a bounded semaphore.
n – int, How many jobs/processes can execute the protected area at the same
time. The (n + 1)th and later job/process wait max timeout
seconds.
Else an error will be triggered.
timeout – float, see decription of argument n
.
lock_directory – str, per default this is ~/.copy_guard_locks
.
filename_pattern – str, per default this is the path to the script which
calls BoundedSemaphore
including the full path plus
a string -NN.lock to enumerate locks, spaces are replaced
by _
.
Bases: object
Connection is an access object for rsync
based copy operations.
user – str, username on the remote computer.
host – str, host name, e.g. remote.unixxx.com
.
private_key – str, path to private key to use. If the path is just a filename
which does not exist in the current working folder, the
~/.ssh
folder is searched for this filename.
port – int, optional. optional port if the remote machine does not listen on the default port 22.
copies a folder with all files locally. this function is optimized for many files, especially on an hpc system.
source – source folder
target – target folder, the basename of source
will be a subfolder in
target
.