UNIX Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOperating SystemsUNIX Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
  #1  
Old January 22nd, 2004, 03:33 PM
JoshHarvill JoshHarvill is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: Spring Hill, Tennessee
Posts: 36 JoshHarvill User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 m 47 sec
Reputation Power: 5
Cron Job with Lynx

If my Lynx directory is /usr/local/bin/lynx and my pwd directory is /usr/local/www/virtual1/12/345/67/89 and I want to set up a cron job for http://mysite.com/script.php every day at 3:30 AM, would it go like this?:

30 3 * * * root /usr/local/bin/lynx /usr/local/www/virtual1/12/345/67/89 http://mysite.com/script.php

I just want to be able to do a cron job for an http address and I've been told I can do that with Lynx, which is installed on the server I'm using.

Reply With Quote
  #2  
Old January 22nd, 2004, 11:14 PM
Scorpions4ever's Avatar
Scorpions4ever Scorpions4ever is online now
Banned ;)
Dev Shed God 5th Plane (7000 - 7499 posts)
 
Join Date: Nov 2001
Location: Glendale, Los Angeles County, California, USA
Posts: 7,442 Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level) 
Time spent in forums: 1 Month 1 h 44 m 37 sec
Reputation Power: 797
Maybe I'm missing something, but what does the pwd directory have to do with getting lynx to hit a web page?
Why not just do this:
30 3 * * * root /usr/local/bin/lynx http://mysite.com/script.php
__________________
Up the Irons
What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
"Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
Down with Sharon Osbourne

Puzzle of the Month solved by sizeablegrin, etienne141 and L7Sqr, superior C/C++ programmers of the month

Reply With Quote
  #3  
Old January 22nd, 2004, 11:28 PM
JoshHarvill JoshHarvill is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: Spring Hill, Tennessee
Posts: 36 JoshHarvill User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 m 47 sec
Reputation Power: 5
I've tried doing a cron job with the pwd directory before because I was told that I needed it when not using Lynx.

I just don't usually work with cron jobs.

Thanks. Hope this works.

Reply With Quote
  #4  
Old January 23rd, 2004, 12:59 AM
Scorpions4ever's Avatar
Scorpions4ever Scorpions4ever is online now
Banned ;)
Dev Shed God 5th Plane (7000 - 7499 posts)
 
Join Date: Nov 2001
Location: Glendale, Los Angeles County, California, USA
Posts: 7,442 Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level) 
Time spent in forums: 1 Month 1 h 44 m 37 sec
Reputation Power: 797
On second thought, you might want to add the --dump option to the command line:
(i.e.)
30 3 * * * root /usr/local/bin/lynx --dump http://mysite.com/script.php

Why do you need --dump? If you don't specify it, lynx may get the page and then wait for input (i.e.) a keypress from you. Since this job is started by a cron daemon, there will never be any keypresses and thus lynx won't terminate. If you specify the --dump option, lynx fetches the page, prints it out and then terminates. In addition, the cron job will take the lynx output and email the owner of the crontab. Thus, you can view the output of the webpage later in the day.

If you don't care much about the webpage output, you can do this instead:
30 3 * * * root /usr/local/bin/lynx --dump http://mysite.com/script.php > /dev/null

Reply With Quote
  #5  
Old February 26th, 2004, 07:47 PM
chewiee chewiee is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 5 chewiee User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Angry CRON and mail

Hi guys, I am trying to get the same thing to work for me, when I mail out a webpage, on a nightly basis.

I have created a file called website_reports and placed it in cron.daily's directory.

From a commandline if I type:

lynx --dump http://195.66.240.211/cgi-bin/whois...omainname.co.uk | mail user@domain.com -s "WhoIs DomainName.co.uk"

it works and I get an email sent to me

from my cronjob I just get a blank email.

My batch file looks like this:

#!/bin/sh
lynx --dump http://195.66.240.211/cgi-bin/whois...omainname.co.uk | mail user@domain.com -s "WhoIs DomainName.co.uk"

How do I do this on my Raq4?

Cheers

Chewiee

Reply With Quote
Reply

Viewing: Dev Shed ForumsOperating SystemsUNIX Help > Cron Job with Lynx


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway