[clamav-users] Terminate clamscan after specific time
Andrew C Aitchison
clamav at aitchison.me.uk
Wed Jan 6 11:30:19 UTC 2021
Would it be better to *pause* the scan if/when the computer gets busy ?
If you "nice" the scan it will only run when the cpu is less busy;
if you have "ionice" you can make it run when the disk is less busy.
On Wed, 6 Jan 2021, Zvi Kave via clamav-users wrote:
> Hi ,
>
> My goal is to terminate scan of big number of files like '/' on CPU
> busy hours. Then to continue approximately from the interrupted
> directory on nonbusy hours. Seems that I have to put some code in
> clamscan/manager.c
>
> Thanks,
>
> Zvi
>
>
> On Tue, Jan 5, 2021 at 6:01 PM G.W. Haywood via clamav-users <
> clamav-users at lists.clamav.net> wrote:
>
> > Hi there,
> >
> > On Tue, 5 Jan 2021, Zvi Kave via clamav-users wrote:
> >
> > > Seems that the parameter --max-scantime=#n aborts scan on every file
> > after #n ms.
> > > But it continues to the next file, instead of clamscan termination +
> > summary as I need.
> >
> > You can easily start another process, which sleeps for your desired
> > number of seconds and then kills the clamscan process. You won't get
> > the exact summary which clamscan gives when it terminates normally, but
> > you will get the output about what's been found so you can approximate
> > the report e.g. by piping the output of the clamscan process to a file
> > (perhaps asking for verbose reporting from libclamav and/or clamscan as
> > well as reporting clean files) and doing a little bit of scripting.
> >
> > This does seem to me to be a strange thing to want to do. If you can
> > explain exactly what the problem is and why you think this is the
> > solution we might be able to offer alternatives or other suggestions.
--
Andrew C. Aitchison Kendal, UK
andrew at aitchison.me.uk
More information about the clamav-users
mailing list