2010-06-12 23:24:25 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
PAR=parallel
|
2011-10-17 01:10:32 +00:00
|
|
|
SERVER1=parallel-server1
|
2010-06-12 23:24:25 +00:00
|
|
|
SERVER2=parallel-server2
|
2011-10-17 01:10:32 +00:00
|
|
|
SSHLOGIN1=parallel@$SERVER1
|
|
|
|
SSHLOGIN2=parallel@$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
|
2011-10-17 01:10:32 +00:00
|
|
|
seq 1 5 | parallel -kS $SSHLOGIN1 --cleanup -B 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
|
|
|
|
|
|
|
|
ls parallel_*.test | parallel -j+0 --trc {.}.out -B my_script \
|
2011-10-17 01:10:32 +00:00
|
|
|
-S $SSHLOGIN1,$SSHLOGIN2,: "./my_script {} > {.}.out"
|
2010-06-12 23:24:25 +00:00
|
|
|
cat parallel_*.test parallel_*.out
|
2010-06-14 22:05:47 +00:00
|
|
|
|