fi
}
-function httracker_get_single {
-# grabs URLs from the network
+function httracker_get_incremental {
+ # Creates target dir
+ year=`date +%Y`
+ month=`date +%m`
+ %day=`date +%d`
+ target=${MIRRORDIR}/${year}/${month}
+ sudo -u links mkdir -p ${target}
+
+ # Grabs URLs from the network
httrack --verbose \
--user links \
--depth=1 \
--purge-old=0 \
--index \
--cookies=1 \
- --list ${tmpfile} \
+ --list ${URLS} \
--path ${target} \
}
-function httracker_target_single {
- # creates target dir
- year=`date +%Y`
- month=`date +%m`
- %day=`date +%d`
- target=${MIRRORDIR}/${year}/${month}
- sudo -u links mkdir -p ${target}
-}
-
function httracker_scuttle_config() {
grep ${1} ${CONFIGFILE} | sed -e s/\[^\'\]\*\'// -e s/\'\.\*\$//
}
--host=${dbhost} \
--execute="${1}"
}
+
+function httracker_iterate {
+ for link in `cat $URLS | xargs`; do
+ httracker_get "$link"
+ done
+}
chmod 600 ${URLS}
httracker_sqlquery "select bAddress from sc_bookmarks;" > ${URLS}
-# Prepare and download
-httracker_target_single
-httracker_get_single
+# Download in incremental mode
+httracker_get_incremental
+
+# Download in mirror mode
+httracker_iterate
# Cleanup
rm -rf $TMP