Find the answer to your Linux question:
Results 1 to 4 of 4
hi, i need to execute/visit a site to check if the site is up or not i have a server that have cron shedule that can execute a php file ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jun 2008
    Posts
    3

    how execute/visit a site using the cron daemon?


    hi,
    i need to execute/visit a site to check if the site is up or not i have a server that have cron shedule that can execute a php file now how can i execute/visite a site using the same way as i execute a file?
    thanks a lot for your help

  2. #2
    Just Joined!
    Join Date
    Jul 2007
    Posts
    49
    You could put a tag in your page and use if curl and grep to see if it is there, if not report an error.
    something like this would probably work:

    Code:
    TAG=`curl yourpage.com |grep "yourtag"`
    if [ -e $TAG ]
    then
    echo "site is up"
    else
    echo "site is down"
    fi
    You could even if you have a mail server running get it to mail the status to you

  3. #3
    Just Joined!
    Join Date
    Jun 2008
    Posts
    3
    hi,
    i dont want see if the site is running or not i just want that cron job visit the site. my question is that:
    the site have a script that run only with the correct url "index.php?etc&etc"
    and when i visit the site with that url the site perform maintense of the content and send emails to the users etc
    so i don´t want do this manualy or see if the site is online or not i just want a way to enter in cron job to visit a site as same way google agent visit or as any single person visit i have see the wget but so far i he dont does want i want probaly because i not using the correct command sintax
    so is this that i need a way to the cron job visit the url just that

  4. $spacer_open
    $spacer_close
  5. #4
    Just Joined!
    Join Date
    Jul 2007
    Posts
    49
    As long as you know the url you need to visit just use curl. Try the man pages for more info but it sounds like it will do what you need. If you need info on the crontab try googleing crontab the wikipedia page also has some usefull info cron - Wikipedia, the free encyclopedia

Posting Permissions

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