LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Suse/Novell
User Name
Password
Suse/Novell This Forum is for the discussion of Suse Linux.

Notices

Reply
 
Search this Thread
Old 07-06-2006, 09:21 AM   #1
thefedexguy
LQ Newbie
 
Registered: Jul 2005
Location: Memphis, TN
Distribution: Suse
Posts: 13

Rep: Reputation: 0
cron tab


Trying to add this to my root's cron but it does not work.
All i get is this bash: syntax error near unexpected token `('
Any help would be great

If you want to get the output of chkrootkit once a day per email at 3 am you can put the following line in root's cron file (the location depends on your distribution; under Debian it is under /var/spool/cron/crontabs/root; you might also find it under /var/spool/cron/tabs/root or something similar):

0 3 * * * (cd /usr/local/chkrootkit; ./chkrootkit 2>&1 | mail -s "chkrootkit output" me@myself.tld)

bash: syntax error near unexpected token `('

http://www.howtoforge.com/howto_chkrootkit_portsentry
 
Old 07-06-2006, 09:28 AM   #2
b0uncer
Guru
 
Registered: Aug 2003
Distribution: CentOS, OS X
Posts: 5,131

Rep: Reputation: Disabled
First of all, I don't think you should edit the file straight away; use crontab -e instead, as root. Second, why are there "(" and ")"? I suppose you don't need them. To me it looks like that should work without them..
 
Old 07-06-2006, 09:37 AM   #3
thefedexguy
LQ Newbie
 
Registered: Jul 2005
Location: Memphis, TN
Distribution: Suse
Posts: 13

Original Poster
Rep: Reputation: 0
I have no clue, i just want to run it once a day and email me the output of the command chkrootkit
 
Old 07-06-2006, 09:40 AM   #4
b0uncer
Guru
 
Registered: Aug 2003
Distribution: CentOS, OS X
Posts: 5,131

Rep: Reputation: Disabled
Quote:
0 3 * * * cd /usr/local/chkrootkit; ./chkrootkit 2>&1 | mail -s "chkrootkit output" me@myself.tld
That does the job I'm quite sure. I have no clue where you got the "()" around it..

EDIT: unless the writer of the "help" text wanted you to notice that the whole thing inside "(" and ")" was the cron job to be run, so you wouldn't be confused about the semicolons or anything..well sounds stupid but that's all I can think of.

Just run crontab -e as root and write the above (quoted) line there, save and that's it. If you use VI as you probably do, then after running "crontab -e" you get the file open, press down-arrow until you're at the last line, then press shift-a to go to Append mode, press ENTER to start a new line and write the above (quoted) line there. If the file is empty, just press shift-a and start typing. When you've written it, press ESC button once (or twice if you're unsure, you should hear a beep) and type :wq and press ENTER to save and exit. You're done.

Last edited by b0uncer; 07-06-2006 at 09:45 AM.
 
Old 07-06-2006, 11:03 AM   #5
thefedexguy
LQ Newbie
 
Registered: Jul 2005
Location: Memphis, TN
Distribution: Suse
Posts: 13

Original Poster
Rep: Reputation: 0
Thanks for the help b0uncer! One more question.
will i need change the permissions on that crontab -e? chmod 600?

I'm very new to this cron stuff. I'm just lost with this crontab root, crontab -e, and cron.daily
 
  


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help me... Linux Server.. With Plesk.. Cron Tab 00tbone00 Linux - General 1 07-15-2006 01:16 AM
FC 4. Modify ALT+TAB behaviour to CTRL+TAB xtracto Linux - Software 1 09-22-2005 02:06 PM
bash "tab tab" - how to turn off? nicflatterie Linux - General 2 04-04-2005 03:09 PM
creating a cron(tab) scheduled thing student04 Linux - Software 5 12-26-2004 09:18 PM
Redirecting output of tab tab benjaminrtz Linux - General 1 04-28-2003 10:11 AM


All times are GMT -5. The time now is 10:13 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