adding the -K flag (=treat symlinked dir on receiver as dir) to the
rsync call in rsync_transfer_cmd() would solve this issue.
some scenarios (following my initial example) for what would happen on
the remote machine:
wd is a valid softlink: -> no action
wd is a directory: -> no action
wd is a broken softlink: -> directory wd is created
wd is missing: -> directory wd is created
Could you add this to parallel?
It is a slight change of behavior compared to previous versions, but I
can't imagine a scenario where it would do harm.
cheers,
Benjamin
On 06/12/2017 08:52 PM, Benjamin Leutner wrote:
Hi,
when parallel transfers a file to a remote machine, e.g. a basefile,
it creates the required directories on remote if they don't exist and
uses pre-existing directories otherwise.
However if the target directory on the remote machine is a symlink to
another directory, it will replace it with a directory instead of
putting the transfered file into the linked target directory.
An example:
# on remote:
mkdir remoteLinkTarget
ln -s $HOME/remoteLinkTarget $HOME/wd
# on local
mkdir wd
touch wd/testfile
parallel --nonall --sshloginfile remoteHosts --basefile wd/testfile
# wd on remote is now a directory containing the testfile and the
symlink is gone
# I would have expected testfile to be placed physically under
$HOME/remoteLinkTarget/testfile
Is it intended to behave like that?
Version: GNU parallel 20170522
Cheers,
Benjamin