]> git.scottworley.com Git - picsort/blame - slurp-pics
Automate fetching from remote hosts
[picsort] / slurp-pics
CommitLineData
89e9c6b7
SW
1#!/bin/bash
2
3while 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"
17done < .slurp-hosts