what is wrong with my script ??

Forum for getting help with Project Gamera, Spamassassin, Clamav, qmail-scanner and other anti-spam tools.
Galactic Zero
Forum Regular
Forum Regular
Posts: 471
Joined: Mon Dec 06, 2004 10:43 pm

what is wrong with my script ??

Unread post by Galactic Zero »

Trying to get sa-update to write to a file which logwatch will include in its report.

/etc/cron.daily/sa_update:

/etc/cron.daily/sa_update: line 4: syntax error near unexpected token `2'
/etc/cron.daily/sa_update: line 4: `&& /sbin/service spamassassin restart > 2>&1 tee -a /var/log/sa-update.log'
Franklyn Halamka
Still learning my way around Linux Security.
http://www.galacticzero.net
scott
Atomicorp Staff - Site Admin
Atomicorp Staff - Site Admin
Posts: 8355
Joined: Wed Dec 31, 1969 8:00 pm
Location: earth
Contact:

Unread post by scott »

/sbin/service spamassassin restart > 2>&1

you probably wanted

/sbin/service spamassassin restart > /dev/null 2>&1
Galactic Zero
Forum Regular
Forum Regular
Posts: 471
Joined: Mon Dec 06, 2004 10:43 pm

Unread post by Galactic Zero »

Ok, fixed script as noted above and restarted crond. Now in logwatch I get this message where I think sa-update.log should show.

--------------------- Cron Begin ------------------------

ORPHAN entries: 1

---------------------- Cron End -------------------------



What am I missing?
Franklyn Halamka
Still learning my way around Linux Security.
http://www.galacticzero.net
scott
Atomicorp Staff - Site Admin
Atomicorp Staff - Site Admin
Posts: 8355
Joined: Wed Dec 31, 1969 8:00 pm
Location: earth
Contact:

Unread post by scott »

make sure you didnt put a blank line or something like that in there, that could cause that to happen too.
Galactic Zero
Forum Regular
Forum Regular
Posts: 471
Joined: Mon Dec 06, 2004 10:43 pm

Unread post by Galactic Zero »

Still not working after checking for blank lines, here is the actual code I'm using:

[root@gz cron.daily]# more sa_update

Code: Select all

/usr/bin/sa-update --allowplugins \
--channel updates.spamassassin.org \
--gpgkey D1C035168C1EBC08464946DA258CDB3ABDE9DC10 --channel saupdates.openprotect.com, \
&& /sbin/service spamassassin restart > /dev/null 2>&1 tee -a /var/log/sa-update.log
[root@gz cron.daily]# 
This produced the orphan message.
Franklyn Halamka
Still learning my way around Linux Security.
http://www.galacticzero.net
Galactic Zero
Forum Regular
Forum Regular
Posts: 471
Joined: Mon Dec 06, 2004 10:43 pm

Unread post by Galactic Zero »

Ok, guess the script is working...

After researching more on the web about the reporting functionality of sa-update I have come to the conclusion that it won't generate a report unless the -D flag is added?

Is this a true statement and therefore my sa-update.log won't be populated unless I enable that in the cron? I think I read that there is a bug on this but can't be sure.

Thanks.
Franklyn Halamka
Still learning my way around Linux Security.
http://www.galacticzero.net
Post Reply