Files, directories and filesystems can be excluded and included in Sophos Anti-Virus for UNIX/Linux scans using the command line options -exclude and -include. NOTE: These options apply to to on-demand scans executed with sweep (SAV4) or savscan (SAV7/9).
For more on exclusions, see the knowledgebase article on the --expand-wildcards option.
Applies to the following Sophos product(s) and version(s) Sophos Anti-Virus for UnixSophos Anti-Virus for Linux
You can use -exclude to specify which items you would like Sophos Anti-Virus to avoid scanning. Any items (files, directories or filesystems) following the command line option -exclude will be excluded from scanning.
sweep fred/home harry/home -exclude tom/home peter/home
will scan fred/home and harry/home, but not tom/home or peter/home.
Any items following the command line option -include will be included in the scan, even if they would otherwise have been excluded.
Both -exclude and -include can be used in the same set of commands.
sweep fred/home harry/home -exclude tom/home peter/home -include bill/home
scans items fred/home, harry/home and bill/home and all their contents. It does not scan tom/home or peter/home.
The option -exclude can be used to exclude files or directories under another directory. For example
sweep /home/fred -exclude /home/fred/games
will scan all of Fred's home directory except for the directory games and all directories and files under it.
The option -include can be used to select files that otherwise would not have been scanned. For example
sweep /home/fred -exclude /home/fred/games -include /home/fred/games/chess
will scan all of the directory /home/fred except /home/fred/games, but will also scan /home/fred/games/chess. The order of the command line qualifiers is not important, the command
sweep /home/fred -include /home/fred/games/chess -exclude /home/fred/games
scans exactly the same files as the first example.
Items to be scanned can be specified in an "arguments file" as well as command line. Use the command line option --args-file=.
This file can also include a list of items to exclude, using the option -exclude.
Every comment submitted here is read (by a human) but we do not reply to specific technical questions. If you need technical support please post a question to our community. Alternatively for licensed products open a support ticket.