]> git.scottworley.com Git - picsort/blame_incremental - slurp-pics
Keep files under two names
[picsort] / slurp-pics
... / ...
CommitLineData
1#!/bin/bash
2
3while read host path;do
4 outdir="slurp-$host"
5 {
6 mkdir -p "$outdir"
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
11 output_filename="$outdir/${filename/jpg/jpeg}"
12 if [[ -e "$output_filename" ]];then
13 echo "skipping $filename" >&2
14 else
15 echo "getting $filename" >&2
16 echo "get -p $filename $output_filename"
17 fi
18 done
19 } | sftp -v -P 19362 -i .slurp-key "slurp@$host"
20 rename-to-date -l "$outdir"/*
21done < .slurp-hosts