]> git.scottworley.com Git - picsort/blob - slurp-pics
7c90ed830df090eb34ed44bf8f02a151770f23c3
[picsort] / slurp-pics
1 #!/bin/bash
2
3 while read host path;do
4 {
5 echo "cd $path"
6 sftp -v -P 19362 -i .slurp-key "slurp@$host" <<< "cd $path"$'\n'"ls -1" |
7 sed 1,2d |
8 while read filename;do
9 if [[ -e "$filename" ]];then
10 echo "skipping $filename" >&2
11 else
12 echo "getting $filename" >&2
13 echo "get -p $filename ${filename/jpg/jpeg}"
14 fi
15 done
16 } | sftp -v -P 19362 -i .slurp-key "slurp@$host"
17 done < .slurp-hosts