Sanesecurity updates

Use this forum if you have installed hMailServer and want to ask a question related to a production release of hMailServer. Before posting, please read the troubleshooting guide. A large part of all reported issues are already described in detail here.
Post Reply
kiekar
Normal user
Normal user
Posts: 72
Joined: 2006-12-27 03:04
Location: Montreal, Canada

Sanesecurity updates

Post by kiekar » 2016-11-23 02:32

Hello,

I recently installed sanesecurity and all seems to work fine but my only concern is the automated signature updates. I created a scheduled task to run every hour which seems to be running fine as I receive no errors however when I check the sigupdate.log file it doesn't update. When updating the sigupdate.bat file manually the log file show the proper time stamp.

Should the sigupdate.log be also updated when using the task schedule?

Gordonh1970
Normal user
Normal user
Posts: 42
Joined: 2016-01-29 13:50
Location: UK
Contact:

Re: Sanesecurity updates

Post by Gordonh1970 » 2016-12-03 22:36

The sigupdate.log file that sanesecurity creates only saves the information from the latest update (in my case every hour)

It should be date and time stamped at the start of the file

agatha
Normal user
Normal user
Posts: 49
Joined: 2015-10-30 11:13

Re: Sanesecurity updates

Post by agatha » 2016-12-05 11:08

Should the sigupdate.log be also updated when using the task schedule?
Yes.
And also the *.hdb and *.cdb files in your clamav database folder get a new time stamp.

My batch looks like:

@echo off
cd /d d:\clamav

set log=D:\Logs\sanesecurity.log
set db=D:\ClamAV\db
set CYGWIN=nontsec

echo %date%-%time% >> %log%
winrsync\rsync.exe --timeout 120 -i -vv -p -z -t rsync://rsync.sanesecurity.net/sanesecurity/* dbtemp
for /f "delims=" %%i in (signames.txt) do echo d|xcopy /F /M /Y "dbtemp\%%i" "%db%\%%i" >> %log%
echo ................................................... >> %log%

freshclam.exe --config-file=freshclam.conf

User avatar
jimimaseye
Moderator
Moderator
Posts: 8713
Joined: 2011-09-08 17:48

Re: Sanesecurity updates

Post by jimimaseye » 2016-12-05 11:22

I get 2 files: a DAILY log file of the days signupdate logs in the form of:

sigupdate_2016-12-05.log

Each daily log file shows all the updates that run through the day.

And then there is a compressed folder of all previous daily logs:

SigUpdateLogs.7z

This happens automatically (it uses the 7za compression program provided by Hmailserver )

Mines batch is like this (Ive stripped out unnecessary REMs and ECHOs):

Code: Select all

for /F "usebackq tokens=1,2 delims==" %%i in (`wmic os get LocalDateTime /VALUE 2^>NUL`) do if '.%%i.'=='.LocalDateTime.' set ldt=%%j
set inDate=%ldt:~0,4%-%ldt:~4,2%-%ldt:~6,2%
set logloc="%ProgramFiles(x86)%\ClamWin\sigupdate"
set sigupdatelog=sigupdate_%inDate%.log
IF EXIST "%appdata%\.clamwin\clamwin.conf" FOR /F "eol=; eol=[ tokens=1,2* delims== " %%i in ('findstr /b /l /i "database"= "%appdata%\.clamwin\clamwin.conf"') DO set db=%%~j

echo Started: %date%-%time% >> %logloc%\%sigupdatelog%
echo Downloading files from mirror...  >> %logloc%\%sigupdatelog%
SET CYGWIN=nontsec

winrsync\rsync.exe >> %logloc%\%sigupdatelog% --timeout 120 -i -vv -p -z -t rsync://rsync.sanesecurity.net/sanesecurity/* dbtemp

for /f "delims=" %%i in (signames.txt) do echo f|xcopy /F /M /Y "dbtemp\%%i" "%db%\%%i" >> %logloc%\%sigupdatelog%

echo Finished: %date%-%time% >> %logloc%\%sigupdatelog%

for %%i in (sigupdate_????-*.log) do if not %%i == %sigupdatelog% "%programfiles(x86)%\hMailServer\Bin\7za" a -t7z %logloc%\SigUpdateLogs.7z -uq0 %%i & del %%i
:fin
(Note it also obtains the DB location from the Clamwin configuration files rather than be hardcoded).
5.7 on test.
SpamassassinForWindows 3.4.0 spamd service
AV: Clamwin + Clamd service + sanesecurity defs : https://www.hmailserver.com/forum/viewtopic.php?f=21&t=26829

Post Reply