2010-06-12 23:24:25 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2023-06-25 20:36:49 +00:00
|
|
|
# SPDX-FileCopyrightText: 2021-2023 Ole Tange, http://ole.tange.dk and Free Software and Foundation, Inc.
|
2021-03-22 20:16:35 +00:00
|
|
|
#
|
|
|
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
|
2011-10-17 01:10:32 +00:00
|
|
|
SERVER1=parallel-server1
|
2023-07-21 02:33:22 +00:00
|
|
|
SERVER2=parallel-server2
|
2020-08-07 20:20:30 +00:00
|
|
|
SSHUSER1=vagrant
|
|
|
|
SSHUSER2=vagrant
|
|
|
|
SSHLOGIN1=$SSHUSER1@$SERVER1
|
|
|
|
SSHLOGIN2=$SSHUSER2@$SERVER2
|
2010-06-12 23:24:25 +00:00
|
|
|
|
|
|
|
cd /tmp
|
2010-06-14 22:05:47 +00:00
|
|
|
|
|
|
|
echo '### Test --basefile with no --sshlogin'
|
|
|
|
echo | stdout parallel --basefile foo echo
|
|
|
|
|
2010-06-12 23:24:25 +00:00
|
|
|
echo '### Test --basefile + --cleanup + permissions'
|
2010-06-14 22:05:47 +00:00
|
|
|
echo echo script1 run '"$@"' > script1
|
|
|
|
echo echo script2 run '"$@"' > script2
|
|
|
|
chmod 755 script1 script2
|
2012-01-08 18:52:00 +00:00
|
|
|
seq 1 5 | parallel -kS $SSHLOGIN1 --cleanup --bf script1 --basefile script2 "./script1 {};./script2 {}"
|
2010-06-12 23:24:25 +00:00
|
|
|
echo good if no file
|
2011-10-17 01:10:32 +00:00
|
|
|
stdout ssh $SSHLOGIN1 ls 'script1' || echo OK
|
|
|
|
stdout ssh $SSHLOGIN1 ls 'script2' || echo OK
|
2010-06-12 23:24:25 +00:00
|
|
|
|
|
|
|
echo '### Test --basefile + --sshlogin :'
|
|
|
|
echo cat '"$@"' > my_script
|
|
|
|
chmod 755 my_script
|
|
|
|
rm -f parallel_*.test parallel_*.out
|
|
|
|
seq 1 13 | parallel echo {} '>' parallel_{}.test
|
|
|
|
|
2012-01-08 18:52:00 +00:00
|
|
|
ls parallel_*.test | parallel -j+0 --trc {.}.out --bf my_script \
|
2011-10-17 01:10:32 +00:00
|
|
|
-S $SSHLOGIN1,$SSHLOGIN2,: "./my_script {} > {.}.out"
|
2018-10-22 22:46:38 +00:00
|
|
|
ls parallel_*.test parallel_*.out | LC_ALL=C sort | xargs cat
|
2010-06-14 22:05:47 +00:00
|
|
|
|
2013-03-24 16:24:59 +00:00
|
|
|
## Broken since 2013-03-23
|
|
|
|
## rm -rf tmp
|
|
|
|
## echo "### Test combined -X --return {/}_{/.}_{#/.}_{#/}_{#.} with files containing space"
|
|
|
|
## stdout parallel -j1 -k -Xv --cleanup --return tmp/{/}_{/.}_{2/.}_{2/}_{2.}/file -S $SSHLOGIN2 \
|
|
|
|
## mkdir -p tmp/{/}_{/.}_{2/.}_{2/}_{2.} \;touch tmp/{/}_{/.}_{2/.}_{2/}_{2.}/file \
|
|
|
|
## ::: /a/number1.c a/number2.c number3.c /a/number4 a/number5 number6 'number 7' 'number <8|8>'
|
|
|
|
## find tmp | sort
|
|
|
|
## rm -rf tmp
|
2012-05-05 22:02:08 +00:00
|
|
|
|
|
|
|
echo "### Here we ought to test -m --return {/}_{/.}_{#/.}_{#/}_{#.} with files containing space"
|
|
|
|
echo "### But we will wait for a real world scenario"
|