#!/bin/sh if [ "$1" = "--output" ]; then output=true shift fi if [ "$1" = "" ]; then daysago=0 else daysago=$1 fi myDate=$(date -Im --date "$daysago days ago") dir="$(pwd)/$(dirname $0)/.." find ${dir}/htdocs/imgs -maxdepth 2 -name 'get' -type f \ -executable -printf '%h\n' | while read i ; do comic=$(basename $i) if [ "$output" = "true" ]; then ${i}/get $daysago else echo "---------------- $myDate ----------------" >> ${dir}/log/${comic}.log ${i}/get $daysago >> ${dir}/log/${comic}.log 2>&1 & fi sleep 2 done