LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 04-16-2006, 01:32 AM   #1
njdube
Member
 
Registered: Mar 2006
Posts: 46

Rep: Reputation: 15
Loading website URL in a Cron Job


I'm trying to use KCron to setup a job to run firefox to load a specific URL every hour.

I get an email error from the Cron Daemon saying this...

Cron <njdube@linux> /opt/MozillaFirefox/bin/firefox.sh http://bbs.freetalklive.com/index.ph...=smite;uid=486
From:
Cron Daemon <root@linux.site>
To:
njdube@linux.site
Date:
Today 12:00:02 am
*
/opt/MozillaFirefox/bin/firefox.sh: line 128: [: too many arguments

(firefox-bin:10376): Gtk-WARNING **: cannot open display: *


This is what I put in to run...

http://bbs.freetalklive.com/index.ph...plaud;uid=1134

The cron part works fine. It runs every hour like I wanted. What's not working is... well you can see the error for your self in the email.

Any idea how to get this to work? The goal is to get the URL "http://bbs.freetalklive.com/index.php?action=modifykarma;sa=smite;uid=486" to load every hour.

I thought of trying w3m but I just started to learn about it and I can't figure out why it doesn't keep the user name and password of the site after closing w3m. As if it's not saving the cookie or something.

I don't really care what browser I use. I just want that URL to load every hour.
 
Old 04-16-2006, 08:47 AM   #2
macemoneta
Senior Member
 
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
Blog Entries: 2

Rep: Reputation: 327Reputation: 327Reputation: 327Reputation: 327
Use wget. It's a command-line utility, and doesn't need access to the X display device.
 
Old 04-16-2006, 04:00 PM   #3
njdube
Member
 
Registered: Mar 2006
Posts: 46

Original Poster
Rep: Reputation: 15
Never mind, someone showed me how to make a script and load that instead.
 
Old 04-17-2006, 11:36 PM   #4
JungleNut
LQ Newbie
 
Registered: Dec 2005
Location: Australia
Distribution: Fedora Core 8
Posts: 17

Rep: Reputation: 0
njdube, would you mind telling us how you solved it? I am also trying to open a url with firefox on a daily schedule and I am getting the same error. I created a shell script to open firefox and load the page I want, and that works fine when manually called from a terminal, but genreates the error above when cron tries to run it.
 
Old 04-17-2006, 11:58 PM   #5
njdube
Member
 
Registered: Mar 2006
Posts: 46

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by JungleNut
njdube, would you mind telling us how you solved it? I am also trying to open a url with firefox on a daily schedule and I am getting the same error. I created a shell script to open firefox and load the page I want, and that works fine when manually called from a terminal, but genreates the error above when cron tries to run it.
I made a script called appalud.sh and put it in /home/njdube/bin

Here is my script

************************************************
export DISPLAY=:0
/opt/MozillaFirefox/bin/firefox.sh "http://bbs.freetalklive.com/index.php?action=modifykarma;sa=applaud;uid=1134;topic=6232.0;m=101694"
************************************************

The above script should only be two lines. This BBS is doing word wrapping crap.

The problem is, for the script to work you have to leave a copy of firefox running when the script is executed. It's a small annoyance if you don't mind leaving firefox running all the time.

I used a KDE program called KCron to set the cron job. I'm still not that happy using the CLI.

Make sure you right click on the script and check mark "Is executable" under the "Permissions" tab if you're in KDE.

I don't know what your experience is in cron jobs. But in KCron make sure every thing is check marked. Except in the minutes section just pick 00. That's if you just want it to run once every hour every day.

In KCron what you're doing is check markting the time you want it to run. It's weird. It just takes getting used to.
 
Old 04-18-2006, 12:45 AM   #6
JungleNut
LQ Newbie
 
Registered: Dec 2005
Location: Australia
Distribution: Fedora Core 8
Posts: 17

Rep: Reputation: 0
Thanks njdube! Adding the line to the script and leaving firefox running has solved my problem.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
calling a url from cron MSEC Linux - Newbie 1 02-12-2006 03:35 AM
need help with cron job parthcorp1 Linux - General 2 02-01-2005 12:37 PM
CRON Job tommytomato Fedora 12 09-13-2004 01:38 AM
cron job working2hard Programming 6 07-28-2004 10:12 PM
cron job? luap Linux - Software 2 03-16-2003 09:48 AM


All times are GMT -5. The time now is 11:00 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration