# Scan Archive¶

One advantage of MSNoise is its ability to be used as an automated monitoring tool. To run every night on the data acquired during the previous day, MSNoise needs to check the data archive for new or modified files. Those files could have been acquired during the last day, but be data of a previously offline station and contain useful information for, say, a month ago. The time to search for is defined in the config. The scan_archive script uses the find command (gnufind on Windows) with the -mtime argument to locate new or modified files. Once located, they are inserted (if new) or updated (if modified) in the data availability table.

To run the code on two Process, execute the following in console:

$msnoise -t 2 scan_archive  ## Special case: first run¶ This script is the same as for the routine, but one has to pass the init argument: $ msnoise -t 2 scan_archive --init


This will scan the data_archive folder the configured stations and will insert all files found in the data_availability table in the database. As usual, calling the script with a –help argument will show its usage.

## Expert (lazy) mode:¶

Sometimes, you only want to scan a few files and run MSNoise on them. To do this simply run:

\$ msnoise scan_archive --path /path/to/where/files/are


and MSNoise will read anything ObsPy can (provided the files have a proper header (network code, station code and channel code). Then, once done, simply run the “populate from DataAvailability” procedure.