]>
git.scottworley.com Git - picsort/blob - slurp-pics
c730a0d0b08adc288bed895ddcbd8c87c85b1ffb
4 LEGACY
='-oHostKeyAlgorithms=+ssh-dss'
5 sftp
=( sftp
-v -P 19362 -i "$KEY" -oConnectTimeout=4 $LEGACY )
7 if [[ ! -e "$KEY" ]];then
9 echo "I generated you a key! Copy $KEY.pub to devices' authorized_keys"
14 while read host path
;do
15 outdir
="slurp-$host-${path//\//,}"
17 mkdir -p "$outdir" "$seendir/$outdir"
19 "${sftp[@]}" "slurp@$host" <<< "cd $path"$'\n'"ls -1" |
21 while read filename;do
22 output_filename="$outdir/${filename/jpg/jpeg}"
23 if [[ -e "$output_filename" || -e "$seendir/$output_filename" ]];then
24 echo "skipping $filename" >&2
26 echo "getting $filename" >&2
27 echo "get -p $filename $output_filename"
30 } | "${sftp[@]}" "slurp@$host"
31 for f in "$outdir"/*;do
34 ./rename-to-date "$outdir"/*