I'm using GNU parallel to execute computation heavy transformations on remote hosts that are more powerful than the one requesting the work.
I am using a bash script located in /usr/local/lib/myscript
, and I'd like to use it on the remote hosts. However, I don't want to require the hosts to have this script, so I'm sending it along the work with --basefile
.
If I supply the filename only, all goes well. But if I supply the full path to a basefile, it doesn't work.
To illustrate:
$ cat /tmp/common.sh
#!/usr/bin/env bash
echo "Hello world! from $(hostname)"
$ cd /tmp
$ parallel --nonall -S 2/user@remote-host --basefile common.sh --cleanup bash common.sh
Hello world! from remote-host
$ parallel --nonall -S 2/user@remote-host --basefile /tmp/common.sh --cleanup "bash {}"
could not make way for new symlink: tmp
rsync error: some files could not be transferred (code 23) at /BuildRoot/Library/Caches/com.apple.xbs/Sources/rsync/rsync-47/rsync/main.c(992) [sender=2.6.9]
cannot delete non-empty directory: tmp
Is there a way to use --basefile
with files outside of the current path? Or should I use a second --trc
and take advantage of the {1}
and {2}
substitution patterns to emulate --basefile
?