freshclam(1)

✨ freshclam β€” the Clam AntiVirus manual page, bestie edition ✨

okay so. you found the freshclam page in section 1 of the Clam AntiVirus manual and I am SO glad you're here. sit down, hydrate, let's get into it πŸ’–


🌸 NAME 🌸

freshclam β€” update virus databases. that's it. that's the whole job. she keeps your virus database fresh, hence the name, iykyk πŸ¦‹


πŸŽ€ SYNOPSIS πŸŽ€

freshclam [options]

πŸ’… DESCRIPTION πŸ’…

freshclam is a virus database update tool for ClamAV. she goes out there, grabs the newest database files, and keeps your setup from being stale. lowkey the most important relationship in your whole antivirus life fr fr πŸ‘‘


✨ OPTIONS ✨

so FreshClam reads its settings from freshclam.conf first, and then you can overwrite any of those settings with command line options. command line wins, always, no cap. here's every single one, and yes I mean every single one, don't skip:

  • -h, --help β€” prints the help info and dips. πŸ‘‹
  • -V, --version β€” prints the version number and exits. short and sweet.
  • -v, --verbose β€” be verbose, bestie. this one makes freshclam print a lot more info than usual. main character energy, she's telling you everything πŸ—£οΈ
  • --debug β€” turns on debug messages from LibClamAV. deep lore mode.
  • --quiet β€” be quiet. only error messages get through. shhh πŸ™ˆ
  • --no-warnings β€” don't print warnings and don't log them either. not today, negativity.
  • --stdout β€” writes all messages to stdout.
  • --show-progress β€” shows the download progress percentage. we love a progress bar πŸ’―
  • --config-file=FILE β€” read configuration from FILE.
  • -l FILE, --log=FILE β€” log the report to FILE.
  • -d, --daemon β€” run in daemon mode. defaults to 12 checks per day unless you say otherwise with --checks or in freshclam.conf. she's living in the background now, iconic.
  • -p FILE, --pid=FILE β€” writes the daemon's pid to FILE.
  • -F, --foreground β€” don't fork into the background. this one's for use in daemon mode.
  • -u USER, --user USER β€” run as USER. by default (when it's started by root) freshclam drops privileges and operates as the clamav user. she knows her place in the permission hierarchy πŸ’…
  • --no-dns β€” this option forces the old non-DNS verification method (without a TTL delay).
  • -c #n, --checks=#n β€” check #n times per day for a new database. #n must be between 1 and 50.
  • --datadir=DIRECTORY β€” install the new database in DIRECTORY. the directory must be writable for the clamav user or the unprivileged user running freshclam, it must already exist, and it must be an absolute path. read that again, she's picky about all three.
  • --daemon-notify=/path/to/clamd.conf β€” notify the daemon about the new database. by default it reads a hardcoded config file, but you can use a different one. both local and TCP sockets are supported.
  • -a IP, --local-address=IP β€” use this (local) IP for HTTP downloads. useful for multi-homed systems. if the binding fails for whatever reason, a warning is issued and freshclam behaves like without this flag.
  • --on-update-execute=COMMAND β€” execute COMMAND after a successful update.
  • --on-error-execute=COMMAND β€” execute COMMAND if an error occurred. and remember, virus database freshness is the most important thing in an anti-virus system. with this option freshclam can alert you (eg. send SMS) when something is going wrong. 🚨
  • --on-outdated-execute=COMMAND β€” execute COMMAND when freshclam reports an outdated version. in the command string %v will be replaced by the new version number.
  • --update-db=DBNAME β€” with this option you can limit updates to a subset of database files. DBNAME should be "main", "daily", "bytecode", "safebrowsing" or one of the 3rd party database names. this option can be used multiple times and only works with the official and 3rd party databases distributed through the ClamAV mirrors β€” your custom databases (specified with DatabaseCustomURL in freshclam.conf) will not be ignored.

🌈 ENVIRONMENT VARIABLES 🌈

freshclam uses these environment variables, bestie, take notes:

  • CURL_CA_BUNDLE β€” (Linux/Unix only, excluding macOS) may be set to the path of a file (bundle) containing one or more CA certificates. this will override the default openssl certificate path.
  • FRESHCLAM_CLIENT_CERT β€” may be set to the path of a file (PEM) containing the client certificate. this may be used for client authentication.
  • FRESHCLAM_CLIENT_KEY β€” may be set to the path of a file (PEM) containing the client private key. this is required if FRESHCLAM_CLIENT_CERT is set.
  • FRESHCLAM_CLIENT_KEY_PASSWD β€” may be set to a password for the client key PEM file. this is required if FRESHCLAM_CLIENT_KEY is set and the PEM file is password protected.
  • CVD_CERTS_DIR β€” specify a directory containing the root CA cert needed to verify detached CVD digital signatures. if not provided, then freshclam will look in the default directory.
πŸ’‘ fun lil fact: the CURL_CA_BUNDLE environment variable is also used by the curl command line tool for the same purpose. sharing is caring 🫢

πŸ¦‹ EXAMPLES πŸ¦‹

(0) download database to the default directory:

freshclam

(1) download database to the current directory:

freshclam --datadir=.

(2) run as a daemon and check 2 times per day for a new database:

freshclam -d -c 2

πŸ’€ RETURN CODES πŸ’€

some return codes of freshclam can be overwritten with a built-in command EXIT_n which can be passed to --on-*-execute, eg. --on-update-execute=EXIT_1 will force freshclam to always return 1 after a successful database update. (yes, that means you can override the exit codes. use that power responsibly, ok?)

  • 0 : Database is up-to-date or successfully updated. πŸŽ‰
  • 40: Unknown option passed.
  • 50: Can't change directory.
  • 51: Can't check MD5 sum.
  • 52: Connection (network) problem.
  • 53: Can't unlink file.
  • 54: MD5 or digital signature verification error.
  • 55: Error reading file.
  • 56: Config file error.
  • 57: Can't create new file.
  • 58: Can't read database from remote server.
  • 59: Mirrors are not fully synchronized (try again later).
  • 60: Can't get information about 'clamav' user from /etc/passwd.
  • 61: Can't drop privileges.
  • 62: Can't initialize logger.

πŸ“ FILES πŸ“

  • /etc/clamav/freshclam.conf

⭐ CREDITS ⭐

please check the full documentation for credits. πŸ’–


πŸ‘‘ AUTHOR πŸ‘‘

Tomasz Kojm <tkojm@clamav.net>, Kevin Lin <klin@sourcefire.com>


πŸ”₯ SEE ALSO πŸ”₯

freshclam.conf(5), clamd(8), clamd.conf(5), clamscan(1)


aaaand that's the whole thing bestie, you ate it. this page is from ClamAV 1.5.4, dated December 4, 2013 β€” like, that's the version and date, no cap. go update your virus database, she's waiting πŸ’…βœ¨πŸ¦‹