2010-04-26 11:24:56 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2010-06-16 03:03:52 +00:00
|
|
|
SERVER1=parallel-server3
|
2010-05-27 06:09:28 +00:00
|
|
|
SERVER2=parallel-server2
|
2010-05-16 13:46:32 +00:00
|
|
|
|
2010-06-12 23:24:25 +00:00
|
|
|
# Make sure sort order is the same
|
|
|
|
export LANG=C
|
|
|
|
|
2010-05-27 06:09:28 +00:00
|
|
|
echo '### Test --transfer --return --cleanup'
|
|
|
|
|
|
|
|
rm -rf /tmp/parallel.file*
|
2010-10-26 23:50:58 +00:00
|
|
|
stdout ssh $SERVER1 rm -rf 'tmp/parallel.file*' '/tmp/parallel.file*'
|
|
|
|
stdout ssh parallel@$SERVER2 rm -rf 'tmp/parallel.file*' '/tmp/parallel.file*'
|
2010-06-16 03:03:52 +00:00
|
|
|
(seq 1 3;echo '>fire';seq 5 10; /bin/echo ' : & ) \n*.jpg'; echo '/./sub dir'; seq 13 20) >/tmp/test17
|
2010-06-12 23:24:25 +00:00
|
|
|
echo '# Create some weirdly files in /tmp'
|
2010-05-27 06:09:28 +00:00
|
|
|
mkdir -p /tmp/parallel.file
|
2010-07-18 13:47:59 +00:00
|
|
|
cat /tmp/test17 | parallel -k /bin/echo file{} '>'/tmp/parallel.file{}.file
|
|
|
|
cat /tmp/test17 | parallel -k /bin/echo /tmp/parallel.file{}.file >/tmp/test17abs
|
|
|
|
cat /tmp/test17 | parallel -k /bin/echo tmp/parallel.file{}.file >/tmp/test17rel
|
2010-05-27 06:09:28 +00:00
|
|
|
|
|
|
|
echo '### --transfer - abspath'
|
2010-10-26 23:50:58 +00:00
|
|
|
stdout ssh $SERVER1 'rm -rf /tmp/parallel.file*'
|
|
|
|
stdout ssh parallel@$SERVER2 'rm -rf /tmp/parallel.file*'
|
2010-07-18 13:47:59 +00:00
|
|
|
cat /tmp/test17abs | parallel -k --transfer --sshlogin $SERVER1,parallel@$SERVER2 cat {}";"rm {}
|
2010-05-27 06:09:28 +00:00
|
|
|
# One of these should give the empty dir /tmp/parallel.file
|
|
|
|
echo good if no file
|
2010-05-30 22:30:01 +00:00
|
|
|
stdout ssh $SERVER1 ls '/tmp/parallel.file*'
|
2010-05-27 06:09:28 +00:00
|
|
|
# The other: No such file or directory
|
|
|
|
stdout ssh parallel@$SERVER2 ls '/tmp/parallel.file*'
|
|
|
|
|
|
|
|
echo '### --transfer - relpath'
|
|
|
|
stdout ssh $SERVER1 'rm -rf tmp/parallel.file*'
|
|
|
|
stdout ssh parallel@$SERVER2 'rm -rf tmp/parallel.file*'
|
|
|
|
cd /
|
2010-07-18 13:47:59 +00:00
|
|
|
cat /tmp/test17rel | parallel -k --transfer --sshlogin $SERVER1,parallel@$SERVER2 cat {}";"rm {}
|
2010-05-27 06:09:28 +00:00
|
|
|
# Should give: No such file or directory
|
|
|
|
echo good if no file
|
|
|
|
stdout ssh $SERVER1 ls 'tmp/parallel.file*'
|
|
|
|
# Should give: No such file or directory
|
|
|
|
stdout ssh parallel@$SERVER2 ls 'tmp/parallel.file*'
|
|
|
|
|
|
|
|
echo '### --transfer --cleanup - abspath'
|
2011-01-17 12:38:58 +00:00
|
|
|
stdout ssh $SERVER1 'rm -rf /tmp/parallel.file*'
|
|
|
|
stdout ssh parallel@$SERVER2 'rm -rf /tmp/parallel.file*'
|
2010-07-18 13:47:59 +00:00
|
|
|
cat /tmp/test17abs | parallel -k --transfer --cleanup --sshlogin $SERVER1,parallel@$SERVER2 cat {}
|
2010-05-27 06:09:28 +00:00
|
|
|
echo good if no file
|
|
|
|
# Should give: No such file or directory
|
|
|
|
stdout ssh $SERVER1 ls '/tmp/parallel.file*'
|
|
|
|
# Should give: No such file or directory
|
|
|
|
stdout ssh parallel@$SERVER2 ls '/tmp/parallel.file*'
|
|
|
|
|
|
|
|
echo '### --transfer --cleanup - relpath'
|
2011-01-17 12:38:58 +00:00
|
|
|
stdout ssh $SERVER1 'rm -rf tmp/parallel.file*'
|
|
|
|
stdout ssh parallel@$SERVER2 'rm -rf tmp/parallel.file*'
|
2010-07-18 13:47:59 +00:00
|
|
|
cat /tmp/test17rel | parallel -k --transfer --cleanup --sshlogin $SERVER1,parallel@$SERVER2 cat {}
|
2010-05-27 06:09:28 +00:00
|
|
|
# Should give: No such file or directory
|
|
|
|
echo good if no file
|
|
|
|
stdout ssh $SERVER1 ls 'tmp/parallel.file*' || echo OK
|
|
|
|
# Should give: No such file or directory
|
|
|
|
stdout ssh parallel@$SERVER2 ls 'tmp/parallel.file*' || echo OK
|
|
|
|
|
|
|
|
echo '### --return - abspath'
|
2011-01-17 12:38:58 +00:00
|
|
|
stdout ssh $SERVER1 'rm -rf /tmp/parallel.file*'
|
|
|
|
stdout ssh parallel@$SERVER2 'rm -rf /tmp/parallel.file*'
|
2010-05-27 06:09:28 +00:00
|
|
|
rm -rf /tmp/parallel.file*out
|
2011-01-17 12:38:58 +00:00
|
|
|
cat /tmp/test17abs | parallel -k --return {.}.out --sshlogin $SERVER1,parallel@$SERVER2 mkdir -p /tmp/parallel.file";"echo {} ">"{.}.out
|
2010-05-27 06:09:28 +00:00
|
|
|
ls /tmp/parallel.file*out /tmp/parallel.file/*out
|
|
|
|
|
|
|
|
echo '### --return - relpath'
|
2011-01-17 12:38:58 +00:00
|
|
|
stdout ssh $SERVER1 'rm -rf tmp/parallel.file*'
|
|
|
|
stdout ssh parallel@$SERVER2 'rm -rf tmp/parallel.file*'
|
2010-05-27 06:09:28 +00:00
|
|
|
rm -rf /tmp/parallel.file*out
|
2010-10-26 23:50:58 +00:00
|
|
|
cat /tmp/test17rel | parallel -k --return {.}.out --sshlogin $SERVER1,parallel@$SERVER2 mkdir -p tmp/parallel.file ';'echo {} ">"{.}.out
|
2010-05-27 06:09:28 +00:00
|
|
|
ls tmp/parallel.file*out tmp/parallel.file/*out
|
|
|
|
|
|
|
|
echo '### --return - multiple files'
|
2011-01-17 12:38:58 +00:00
|
|
|
stdout ssh $SERVER1 'rm -rf tmp/parallel.file*'
|
|
|
|
stdout ssh parallel@$SERVER2 'rm -rf tmp/parallel.file*'
|
2010-05-27 06:09:28 +00:00
|
|
|
rm -rf tmp/parallel.file*out tmp/parallel.file/*out tmp/parallel.file*done tmp/parallel.file/*done
|
2010-07-18 13:47:59 +00:00
|
|
|
cat /tmp/test17rel | parallel -k --return {.}.out --return {}.done \
|
2011-01-17 12:38:58 +00:00
|
|
|
--sshlogin $SERVER1,parallel@$SERVER2 mkdir -p tmp/parallel.file ';'echo {} ">"{.}.out';'echo {} ">"{}.done';'
|
2010-05-27 06:09:28 +00:00
|
|
|
ls tmp/parallel.file*out tmp/parallel.file/*out tmp/parallel.file*done tmp/parallel.file/*done
|
|
|
|
|
|
|
|
echo '### --return --cleanup - abspath'
|
2011-01-17 12:38:58 +00:00
|
|
|
stdout ssh $SERVER1 'rm -rf /tmp/parallel.file*'
|
|
|
|
stdout ssh parallel@$SERVER2 'rm -rf /tmp/parallel.file*'
|
2010-05-27 06:09:28 +00:00
|
|
|
rm -rf /tmp/parallel.file*out /tmp/parallel.file/*out /tmp/parallel.file*done /tmp/parallel.file/*done
|
2010-07-18 13:47:59 +00:00
|
|
|
cat /tmp/test17abs | parallel -k --return {.}.out --return {}.done --cleanup \
|
2011-01-17 12:38:58 +00:00
|
|
|
--sshlogin $SERVER1,parallel@$SERVER2 mkdir -p /tmp/parallel.file ';'echo {} ">"{.}.out';'echo {} ">"{}.done';'
|
2010-05-27 06:09:28 +00:00
|
|
|
ls /tmp/parallel.file*out /tmp/parallel.file/*out /tmp/parallel.file*done /tmp/parallel.file/*done
|
|
|
|
echo good if no file
|
|
|
|
stdout ssh $SERVER1 ls '/tmp/parallel.file*' || echo OK
|
|
|
|
# Should give: No such file or directory
|
|
|
|
stdout ssh parallel@$SERVER2 ls '/tmp/parallel.file*' || echo OK
|
|
|
|
|
|
|
|
echo '### --return --cleanup - relpath'
|
|
|
|
rm -rf tmp/parallel.file*out tmp/parallel.file/*out tmp/parallel.file*done tmp/parallel.file/*done
|
2011-01-17 12:38:58 +00:00
|
|
|
stdout ssh $SERVER1 'rm -rf tmp/parallel.file*'
|
|
|
|
stdout ssh parallel@$SERVER2 'rm -rf tmp/parallel.file*'
|
2010-07-18 13:47:59 +00:00
|
|
|
cat /tmp/test17rel | parallel -k --return {.}.out --return {}.done --cleanup \
|
2010-10-26 23:50:58 +00:00
|
|
|
--sshlogin $SERVER1,parallel@$SERVER2 mkdir -p tmp/parallel.file ';'echo {} ">"{.}.out';'echo {} ">"{}.done';'
|
2010-05-27 06:09:28 +00:00
|
|
|
ls tmp/parallel.file*out tmp/parallel.file/*out tmp/parallel.file*done tmp/parallel.file/*done
|
|
|
|
echo good if no file
|
|
|
|
stdout ssh $SERVER1 ls 'tmp/parallel.file*' || echo OK
|
|
|
|
# Should give: No such file or directory
|
|
|
|
stdout ssh parallel@$SERVER2 ls 'tmp/parallel.file*' || echo OK
|
|
|
|
|
|
|
|
echo '### --return --cleanup - multiple returns'
|
2011-01-17 12:38:58 +00:00
|
|
|
stdout ssh $SERVER1 'rm -rf tmp/parallel.file*'
|
|
|
|
stdout ssh parallel@$SERVER2 'rm -rf tmp/parallel.file*'
|
2010-05-27 06:09:28 +00:00
|
|
|
rm -rf tmp/parallel.file*out tmp/parallel.file/*out tmp/parallel.file*done tmp/parallel.file/*done
|
2010-07-18 13:47:59 +00:00
|
|
|
cat /tmp/test17rel | parallel -k --return {.}.out --return {}.done --cleanup \
|
2010-10-26 23:50:58 +00:00
|
|
|
--sshlogin $SERVER1,parallel@$SERVER2 mkdir -p tmp/parallel.file ';'echo {} ">"{.}.out';'echo {} ">"{}.done';'
|
2010-05-27 06:09:28 +00:00
|
|
|
ls /tmp/parallel.file*out /tmp/parallel.file/*out /tmp/parallel.file*done /tmp/parallel.file/*done
|
|
|
|
echo good if no file
|
|
|
|
stdout ssh $SERVER1 ls 'tmp/parallel.file*' || echo OK
|
|
|
|
# Should give: No such file or directory
|
|
|
|
stdout ssh parallel@$SERVER2 ls 'tmp/parallel.file*' || echo OK
|
|
|
|
|
|
|
|
echo '### --transfer --return --cleanup - abspath'
|
2011-01-17 12:38:58 +00:00
|
|
|
stdout ssh $SERVER1 'rm -rf /tmp/parallel.file*'
|
|
|
|
stdout ssh parallel@$SERVER2 'rm -rf /tmp/parallel.file*'
|
2010-05-27 06:09:28 +00:00
|
|
|
rm -rf /tmp/parallel.file*out /tmp/parallel.file/*out /tmp/parallel.file*done /tmp/parallel.file/*done
|
2010-07-18 13:47:59 +00:00
|
|
|
cat /tmp/test17abs | parallel -k --transfer --return {.}.out --return {}.done --cleanup \
|
2010-10-26 23:50:58 +00:00
|
|
|
--sshlogin $SERVER1,parallel@$SERVER2 cat {} ">"{.}.out';'cat {} ">"{}.done';'
|
2010-05-27 06:09:28 +00:00
|
|
|
ls /tmp/parallel.file*out /tmp/parallel.file/*out /tmp/parallel.file*done /tmp/parallel.file/*done
|
|
|
|
echo good if no file
|
|
|
|
stdout ssh $SERVER1 ls '/tmp/parallel.file*' || echo OK
|
|
|
|
# Should give: No such file or directory
|
|
|
|
stdout ssh parallel@$SERVER2 ls '/tmp/parallel.file*' || echo OK
|
|
|
|
|
|
|
|
|
|
|
|
echo '### --transfer --return --cleanup - relpath'
|
2011-01-17 12:38:58 +00:00
|
|
|
stdout ssh $SERVER1 'rm -rf tmp/parallel.file*'
|
|
|
|
stdout ssh parallel@$SERVER2 'rm -rf tmp/parallel.file*'
|
2010-05-27 06:09:28 +00:00
|
|
|
rm -rf tmp/parallel.file*out tmp/parallel.file/*out tmp/parallel.file*done tmp/parallel.file/*done
|
2010-07-18 13:47:59 +00:00
|
|
|
cat /tmp/test17rel | parallel -k --transfer --return {.}.out --return {}.done --cleanup \
|
2010-05-27 06:09:28 +00:00
|
|
|
--sshlogin $SERVER1,parallel@$SERVER2 mkdir -p tmp ';'cat {} ">"{.}.out';'cat {} ">"{}.done';'
|
|
|
|
ls /tmp/parallel.file*out /tmp/parallel.file/*out /tmp/parallel.file*done /tmp/parallel.file/*done
|
|
|
|
echo good if no file
|
|
|
|
stdout ssh $SERVER1 ls 'tmp/parallel.file*' || echo OK
|
|
|
|
# Should give: No such file or directory
|
|
|
|
stdout ssh parallel@$SERVER2 ls 'tmp/parallel.file*' || echo OK
|
|
|
|
|
|
|
|
echo '### --transfer --return --cleanup - multiple files'
|
2011-01-17 12:38:58 +00:00
|
|
|
stdout ssh $SERVER1 'rm -rf tmp/parallel.file*'
|
|
|
|
stdout ssh parallel@$SERVER2 'rm -rf tmp/parallel.file*'
|
2010-05-27 06:09:28 +00:00
|
|
|
rm -rf tmp/parallel.file*out tmp/parallel.file/*out tmp/parallel.file*done tmp/parallel.file/*done
|
2010-07-18 13:47:59 +00:00
|
|
|
cat /tmp/test17rel | parallel -k --transfer --return {.}.out --return {}.done --cleanup \
|
2010-05-27 06:09:28 +00:00
|
|
|
--sshlogin $SERVER1,parallel@$SERVER2 mkdir -p tmp ';'cat {} ">"{.}.out';'cat {} ">"{}.done';'
|
|
|
|
ls /tmp/parallel.file*out /tmp/parallel.file/*out /tmp/parallel.file*done /tmp/parallel.file/*done
|
|
|
|
stdout ssh $SERVER1 ls 'tmp/parallel.file*' || echo OK
|
|
|
|
# Should give: No such file or directory
|
|
|
|
stdout ssh parallel@$SERVER2 ls 'tmp/parallel.file*' || echo OK
|
|
|
|
|
|
|
|
echo '### --trc - abspath'
|
2011-01-17 12:38:58 +00:00
|
|
|
stdout ssh $SERVER1 'rm -rf /tmp/parallel.file*'
|
|
|
|
stdout ssh parallel@$SERVER2 'rm -rf /tmp/parallel.file*'
|
2010-05-27 06:09:28 +00:00
|
|
|
rm -rf /tmp/parallel.file*out /tmp/parallel.file/*out /tmp/parallel.file*done /tmp/parallel.file/*done
|
2010-07-18 13:47:59 +00:00
|
|
|
cat /tmp/test17abs | parallel -k --trc {.}.out --trc {}.done \
|
2010-05-27 06:09:28 +00:00
|
|
|
--sshlogin $SERVER1,parallel@$SERVER2 mkdir -p tmp ';'cat {} ">"{.}.out';'cat {} ">"{}.done';'
|
|
|
|
ls /tmp/parallel.file*out /tmp/parallel.file/*out /tmp/parallel.file*done /tmp/parallel.file/*done
|
|
|
|
echo good if no file
|
|
|
|
stdout ssh $SERVER1 ls '/tmp/parallel.file*' || echo OK
|
|
|
|
# Should give: No such file or directory
|
|
|
|
stdout ssh parallel@$SERVER2 ls '/tmp/parallel.file*' || echo OK
|
|
|
|
|
|
|
|
echo '### --trc - relpath'
|
2011-01-17 12:38:58 +00:00
|
|
|
stdout ssh $SERVER1 'rm -rf tmp/parallel.file*'
|
|
|
|
stdout ssh parallel@$SERVER2 'rm -rf tmp/parallel.file*'
|
2010-05-27 06:09:28 +00:00
|
|
|
rm -rf tmp/parallel.file*out tmp/parallel.file/*out tmp/parallel.file*done tmp/parallel.file/*done
|
2010-07-18 13:47:59 +00:00
|
|
|
cat /tmp/test17rel | parallel -k --trc {.}.out --trc {}.done \
|
2010-05-27 06:09:28 +00:00
|
|
|
--sshlogin $SERVER1,parallel@$SERVER2 mkdir -p tmp ';'cat {} ">"{.}.out';'cat {} ">"{}.done';'
|
|
|
|
ls tmp/parallel.file*out tmp/parallel.file/*out tmp/parallel.file*done tmp/parallel.file/*done
|
|
|
|
echo good if no file
|
|
|
|
stdout ssh $SERVER1 ls 'tmp/parallel.file*' || echo OK
|
|
|
|
# Should give: No such file or directory
|
|
|
|
stdout ssh parallel@$SERVER2 ls 'tmp/parallel.file*' || echo OK
|
|
|
|
|
|
|
|
echo '### --trc - multiple files'
|
2011-01-17 12:38:58 +00:00
|
|
|
stdout ssh $SERVER1 'rm -rf /tmp/parallel.file*'
|
|
|
|
stdout ssh parallel@$SERVER2 'rm -rf /tmp/parallel.file*'
|
2010-05-27 06:09:28 +00:00
|
|
|
rm -rf /tmp/parallel.file*out /tmp/parallel.file/*out /tmp/parallel.file*done /tmp/parallel.file/*done
|
2010-07-18 13:47:59 +00:00
|
|
|
cat /tmp/test17abs | parallel -k --trc {.}.out --trc {}.done \
|
2010-05-27 06:09:28 +00:00
|
|
|
--sshlogin $SERVER1,parallel@$SERVER2 mkdir -p tmp ';'cat {} ">"{.}.out';'cat {} ">"{}.done';'
|
|
|
|
ls /tmp/parallel.file*out /tmp/parallel.file/*out /tmp/parallel.file*done /tmp/parallel.file/*done
|
|
|
|
echo good if no file
|
|
|
|
stdout ssh $SERVER1 ls '/tmp/parallel.file*' || echo OK
|
|
|
|
# Should give: No such file or directory
|
|
|
|
stdout ssh parallel@$SERVER2 ls '/tmp/parallel.file*' || echo OK
|
2010-07-18 13:47:59 +00:00
|
|
|
|
2010-07-18 16:04:07 +00:00
|
|
|
echo '### --transfer --cleanup - multiple argument files'
|
2011-05-05 15:37:27 +00:00
|
|
|
parallel --xapply -kv --transfer --cleanup -Sparallel@$SERVER2 cat {2} {1} :::: /tmp/test17rel <(sort -r /tmp/test17abs)
|
2010-07-18 13:47:59 +00:00
|
|
|
# Should give: No such file or directory
|
|
|
|
stdout ssh parallel@$SERVER2 ls '/tmp/parallel.file*' || echo OK
|
|
|
|
|