]>
Commit | Line | Data |
---|---|---|
89e9c6b7 SW |
1 | #!/bin/bash |
2 | ||
3 | while read host path;do | |
348610a4 | 4 | outdir="slurp-$host" |
89e9c6b7 | 5 | { |
348610a4 | 6 | mkdir -p "$outdir" |
89e9c6b7 SW |
7 | echo "cd $path" |
8 | sftp -v -P 19362 -i .slurp-key "slurp@$host" <<< "cd $path"$'\n'"ls -1" | | |
9 | sed 1,2d | | |
10 | while read filename;do | |
348610a4 SW |
11 | output_filename="$outdir/${filename/jpg/jpeg}" |
12 | if [[ -e "$output_filename" ]];then | |
89e9c6b7 SW |
13 | echo "skipping $filename" >&2 |
14 | else | |
15 | echo "getting $filename" >&2 | |
348610a4 | 16 | echo "get -p $filename $output_filename" |
89e9c6b7 SW |
17 | fi |
18 | done | |
19 | } | sftp -v -P 19362 -i .slurp-key "slurp@$host" | |
348610a4 | 20 | rename-to-date -l "$outdir"/* |
89e9c6b7 | 21 | done < .slurp-hosts |