I would like to manually download the main.cvd for clamav and then import it from a local location. I see this is possible using clamav-clamfresh if I configure it to use DatabaseMirror machine1.example.com but that requires running an http webserver on port 80 of machine1.example.com which I don't want to do.
If I get the main.cvd file onto a machine is there some way to manually trigger the import?
13 Answers
You could probably do a script like so to download the updated file then copy it over to the proper location for an update manually.
Script contents
#!/bin/bash
wget
sudo cp main.cvd /var/lib/clamav/
sudo chown clamav:clamav /var/lib/clamav/main.cvd
sudo chmod 644 /var/lib/clamav/main.cvd 2 If clamav have been installed from official repositories, the database folder is /var/lib/clamav
This folder contains some files, not only main.cvd
3 files are part of the database:
Once a machine1 have his ClamAV updated with freshclam (or so), another machine2 can copy the directory content to his local /var/lib/clamav folder.
To check if manual update of machine2 has worked, you can compare the outputs of clamscan --version on machine1 and machine2. And/or compare md5sum of .cvd files.
This could be pretty easy to script with some backup and rollback actions in case of failure.
Of course, the embedded Private Local Mirror feature seems more elegant but require a local webserver.
Change the User-Agent to something unique
wget --user-agent='CVDUPDATE/0 (43fde49b-905f-43c6-a51b-e1324cd23280)'