[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
--return conditional on exit status
From: |
Benjamin Leutner |
Subject: |
--return conditional on exit status |
Date: |
Wed, 18 Jan 2017 19:16:07 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 |
Hi,
is it possible to return results from a remote server _only if_ they
were created?
Use case: I run a script on remote which will not always create an output.
This is intentional, thus not writing a file is not an error.
However, in that case I would like '--return' to be ignored in order not
to spam my stderr with false positives.
An example:
function fu {
echo "no file produced"
exit 8
}
export -f fu
Currently I get:
parallel --sshloginfile MYMACHINES --env fu --return nonexistentfile
'fu' ::: 1
#>no file produced
#>rsync: link_stat "/home/remoteuser/nonexistentfile" failed: No such
file or directory (2)
#>rsync error: some files/attrs were not transferred (see previous
errors) (code 23) at main.c(1655) [generator=3.1.1]
My wishful thinking:
parallel --sshloginfile MYMACHINES --env fu --return nonexistentfile
--skip-return-status 8 'fu' ::: 1
#>no file produced
Best,
Benjamin
- --return conditional on exit status,
Benjamin Leutner <=