diff options
-rwxr-xr-x | httracker | 4 | ||||
-rw-r--r-- | lib/httracker/functions | 28 | ||||
-rwxr-xr-x | scuttler | 8 |
3 files changed, 22 insertions, 18 deletions
@@ -22,9 +22,7 @@ if [ "$?" != "0" ]; then fi # Iterate over all URLs -for link in `cat $URLS | xargs`; do - httracker_get "$link" -done +httracker_iterate # Cleanup rm -rf $TMP diff --git a/lib/httracker/functions b/lib/httracker/functions index ea9a7fa..c7dff7f 100644 --- a/lib/httracker/functions +++ b/lib/httracker/functions @@ -41,27 +41,25 @@ function httracker_get { 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/\'\.\*\$// } @@ -74,3 +72,9 @@ httracker_sqlquery() { --host=${dbhost} \ --execute="${1}" } + +function httracker_iterate { + for link in `cat $URLS | xargs`; do + httracker_get "$link" + done +} @@ -25,9 +25,11 @@ chown links.links ${URLS} 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 |