• Post Reply Bookmark Topic Watch Topic
  • New Topic

how to write a cronjob type thing to access certain web site ?  RSS feed

 
Steve Mutanson
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I want to invoke a scheduled task to the following --- open a browser and access a web site. Can I do that and how ? The reason why I want this is -- our unix server is periodically rebooted, so I want to invoke the servlet on the server, usually the first time costs a long time because it needs to load everything from scratch, and the following access will be much faster. That's why I want to make such initial page hit.
Thanks,
steve
 
Tim Holloway
Saloon Keeper
Posts: 18797
74
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bringing up a browser from cron - or for that matter, from any background process - is a problem, not just in making it work and making it work reliably, but in that if I'm working on something and some background process brings up a GUI program out of nowhere and slaps it over whatever I've been doing, it's rather rude.
However for what you want, you can use the "wget" utility. In fact, probably wget and pipe the output to /dev/null.
 
SJ Adnams
Ranch Hand
Posts: 925
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
wget is a good solution.
xvfb is another alternative if you insist on running a browser.
 
Alton Hernandez
Ranch Hand
Posts: 443
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Steve Mutanson:
I want to invoke a scheduled task to the following --- open a browser and access a web site. Can I do that and how ?

If I understand your question correctly, you just want to trigger a process in your web server thru http request. Well, you can try lynx.
 
Steve Mutanson
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks for the help.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!