LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-22-2003, 07:51 PM   #1
jungsonn
LQ Newbie
 
Registered: Mar 2003
Posts: 2

Rep: Reputation: 0
Question Cronjob question


Hy there.

I have a cronjob question,

i have my own server.

and i want to make a cronjob that runs every hour to check
an index.html, if a piece of <javascript> code is present in the source.
If the javascript code isn't there, i would like to receive an email about it.

Well, thats it and i'm a super newbee, so any help would be greatly apreciated...!

Ecuse me if i ask to much, but i have realy no clue howto do such a thing... thanks in advance.

Ronald.

Last edited by jungsonn; 03-22-2003 at 07:56 PM.
 
Old 03-22-2003, 08:34 PM   #2
cuckoopint
Member
 
Registered: Feb 2003
Distribution: Debian
Posts: 797

Rep: Reputation: 30
hmm...does this javasrcript code have some unique text?

if so a simple search pattern should do the job (perl, grep, etc.), combined with your mailer (which would be), and crontab.
for crontab, see:
man 1 crontab (crontab -e to edit, etc.)
man 5 crontab (how to write the crontab entry)

PS. most likely you want the search/mailer in a bash/perl script (with error checking) and then just invoke the script with crontab.

Hope this was not to vague, I guess you could post back with more specific problems.
 
Old 03-22-2003, 08:48 PM   #3
jungsonn
LQ Newbie
 
Registered: Mar 2003
Posts: 2

Original Poster
Rep: Reputation: 0
Let me explain the peoblem i encounter.

*I want to give away free hosting for a group of webmasters.
*The're webspace have ftp acces
*Every site, with there index MUST contain a bannercode.
*Like geocties that autoinclude a bannerscript.
*I am affriad they will remove my bannercode.
* so i like to do a checkup, if the code exist intheir index.html

This is because i do not know how to parse every uploaded html file, with my banner code... via ftp.
do you get it? ;-)
The ideal situation was this:

When they upload there index.html, there would be added a javascript bannercode into there index.html, automaticly.
but how?

i do not know
 
Old 03-22-2003, 09:04 PM   #4
cuckoopint
Member
 
Registered: Feb 2003
Distribution: Debian
Posts: 797

Rep: Reputation: 30
Quote:
When they upload there index.html, there would be added a javascript bannercode into there index.html, automaticly.
but how?
most likely sed. Sorry, but I don't know it well enough myself.

and you're right about the 'ideal' part: there are too many ways to get around the searching method, it will get to complicated. What you're looking for is a program that will find a line of code (eg. <body>) and append your text to it.
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
cronjob help meeh Linux - General 1 03-26-2004 11:41 AM
Cronjob engnet Linux - Networking 6 03-03-2004 09:21 AM
cronjob ugob Linux - Software 0 03-03-2004 09:20 AM
Su in a cronjob michedlp Programming 3 11-06-2003 08:30 AM
cronjob FastEddy Linux - General 1 04-12-2003 09:52 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:10 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration