1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

What is SSH commands for this: run 20 times, break 2 seconds, and repeated again

Discussion in 'Site & Server Administration' started by basketmen, Dec 20, 2015.

  1. #1
    basketmen, Dec 20, 2015 IP
  2. samirj09

    samirj09 Well-Known Member

    Messages:
    335
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    125
    #2

    This should work:
    while true; do x=20 ; while [[ $x -ge "1" ]] ; do wget http://www.domain.com ; x=$(($x-1)) ; done ; sleep 2 ; done
    Code (markup):
    Although, on a side note, unless your intent is to have tons of files downloaded to the directory you run this in, I would recommend modifying your wget command to include a "-O /dev/null". Below is the modified loop.

    while true; do x=20 ; while [[ $x -ge "1" ]] ; do wget -O /dev/null http://www.domain.com ; x=$(($x-1)) ; done ; sleep 2 ; done
    Code (markup):
     
    Last edited: Dec 21, 2015
    samirj09, Dec 21, 2015 IP