Register a domain and help support LQ
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 10-06-2006, 08:45 PM   #1
LQ Newbie
Registered: Sep 2006
Location: Sanford
Distribution: OpenMandriva Lx
Posts: 21

Rep: Reputation: 0
Questions about shell scripting and cron jobs

I am new to this forum, I've been using Mandrake 10.1 Official for over a year now, for over 7 months exclusively (finally did away with windoze!), and just recently I've decided to try and learn a few new things with linux. I've been trying to work out a way to set my modem to dial up at a certain time every night, download updates to my anti-virus (which is f-prot), run my anti-virus, and then run chkrootkit. I've written an insanely simple shell script which looks like this:


wvdial &

cd /usr/local/f-prot/tools
perl &

chkrootkit &

cd /usr/local/f-prot
./f-prot / -silent -report=/home/carl/virusscan


I then used vim to edit my root crontab to run this script at 2 a.m. Basically what happens is it runs wvdial, connects to the internet, and that's it. I tried to take the wvdial command out, put it in the crontab first, then run the modified shell script, again all it runs is wvdial. Also, if I just connect to the internet myself, then run the shell script, it runs chkrootkit first, then f-prot, then starts running the check-updates. To be sure I'm using the wrong syntax or forgetting to add something, but like I said, I'm just recently learning how to use this. Any ideas or suggestions? Any would be most appreciated.
Old 10-06-2006, 10:13 PM   #2
Registered: Oct 2004
Distribution: Slackware
Posts: 376

Rep: Reputation: 31
You obviously need these commands to be run in a specific order (connect to internet, THEN check for virus signature updates, THEN run virus scanner), yet you use "&" on virtually every line, which will cause those commands to be run in the background. This is probably not what you want, so remove the &'s:



cd /usr/local/f-prot/tools


cd /usr/local/f-prot
./f-prot / -silent -report=/home/carl/virusscan
Old 10-06-2006, 10:34 PM   #3
LQ Newbie
Registered: Sep 2006
Location: Sanford
Distribution: OpenMandriva Lx
Posts: 21

Original Poster
Rep: Reputation: 0
Ok, I'll give that a try, let you know how it worked. Thanks!


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Shell Scripting Questions blaoulis Programming 5 07-12-2006 07:21 PM
Questions corcerning Cron jobs steve_2010 Solaris / OpenSolaris 2 02-03-2004 08:53 AM
CRON Jobs scottpioso Linux - Software 63 11-28-2003 06:45 PM
Two Linux shell scripting questions thepryme Programming 5 10-23-2003 07:01 AM
cron jobs Zyanid Linux - Software 0 08-27-2002 05:10 AM

All times are GMT -5. The time now is 05:17 PM.

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