SUSE / openSUSEThis Forum is for the discussion of Suse Linux.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
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):
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..
0 3 * * * cd /usr/local/chkrootkit; ./chkrootkit 2>&1 | mail -s "chkrootkit output" email@example.com
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.