Find the answer to your Linux question:
Results 1 to 2 of 2
Hi, I am totally new in learning to write an Unix script. I want to automate the WebHTTrack downloading website process. I had tried to write a simple script and ...
  1. #1
    Just Joined!
    Join Date
    Feb 2008
    Posts
    27

    Automate Script

    Hi, I am totally new in learning to write an Unix script.
    I want to automate the WebHTTrack downloading website process. I had tried to write a simple script and it runs! But i didnt use any variables, the website URL and directory is fixed.

    Can anyone guides me step-by-step so that i can automate the webHTTrack and make it to download 20-30 websites?

    Following is the simple script that i tried to write:
    #!/bin/sh
    # purpose: automate webHTTtack downloading process

    httrack -q -%i -w http://www.www.calpoly.edu-O /data/websites/Calpoly -n -%P -N0 -s2 -p7 -D -a -K0 -c4 -%k -r1 -%e1 -A25000
    echo "download completed"

    Appreciate your help & guidiance.
    Love

  2. #2
    tpl
    tpl is offline
    Linux User
    Join Date
    Jan 2007
    Location
    cleveland
    Posts
    452
    well, if all yr websites are of the form
    "http://www.something" then if you had a list
    "websites" of the somethings, you could try it like
    this:

    #!/bin/sh
    #purpose: automate webHTTtack downloading process
    #7 july 2009
    #
    for i in `cat websites`
    do
    mkdir /data/websites/$i
    httrack -q -%i -w http://www.$i /data/websites/$i -n -%P -N0 -s2 -p7 -D -a -K0 -c4 -%k -r1 -%e1 -A25000
    done
    echo "download completed"

    the directory names would be more complex than in yr
    example: but perhaps you could introduce another
    variable "j=cut -d. -f1 $i" removing the ".edu" part
    the sun is new every day (heraclitus)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...