Wiki
Clone wikifswalker / Wiki_Run_fswalk
Running fswalk and generating the files metadata DB
fswalk is the scanner part of the FSWalk project. This program scan a given filesystem tree and produces an sqlite3 database with information about each file in the scanned filesystem tree. This database can be later analyzed using the fsquery tool or directly by accessing the database from any programming language that supports sqlite (there are many).
First, run fswalk --help to obtain the help screen. Below is a list of the major flags of fswalk:
- --dir DIR - The directory to scan (recursively of course)
- --output DIR - The output directory to use for storing the resulting database.
- --dbprefix PREFIX - A prefix to prepend to the database file
- --delay-milli MILLI - The number of milliseconds to sleep after scanning a predefined number of files.
- --delay-files NUM - The number of files to scan before performing a delay (see the --delay-mili option)
- -p - Print a one line progress bar during the scan
Note: fswalk should run with root permissions in order to be able to access all files
If fswalk is to run without root permissions use the --noroot. This will signal fswalk to avoid generating a lock file which requires root permissions.
The following line is an example of using the fswalk:
> fswalk --dir /usr --output /opt/dbs/fswalk/ --dbprefix USR-SCAN -p
The above example will scan the /usr directory and use /opt/dbs/fswalk as the output dir. The database output file will start with USR-SCAN and a one line progress bar will be displayed during the scan.
Since the scan may be long (sometimes very long) it is better to run fswalk in the background without a controlling terminal, so in case you close the terminal you started the command from fswalk will not exit.
It is also recommended to inject delays when scanning a busy filesystem since the scan may incure additional load on the server. To do that set the --delay-files and the --delay-milli arguments to control the frequency and the length of the delay.
Progress Bar Description
Below is an example of the progress bar produced by fswalk.
Active : [top-dirs: 1/8] [f: 24000 d: 3765] [depth: 5:12] [err: p 0 d 0]
Updated