Run bash script from webhost

Discussion in 'Programming' started by ntesla123, Mar 29, 2011.

  1. #1
    If I have a bash script like this:

    
    while true
    do
    wget www.***.com >> file
    sleep 3600
    done
    
    Code (markup):
    Is it possible to upload it to a webhost and have it run indefinitely.

    I have a hostgator account. How do I do this?
     
    ntesla123, Mar 29, 2011 IP
  2. jazzcho

    jazzcho Peon

    Messages:
    326
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Upload it through the file manager, and create a wrapper php script that will run it. Probably something like
    . But! It depends on how hostgator is configuring its hosting, so it may need some tweaking. Afte you get it to run once, schedule the php script to execure through cron (probably on CPanel somewhere).
     
    jazzcho, Mar 29, 2011 IP