Niente Version 4 : Runtime Parameters

1.0 Introduction

Niente is, inevitably, a heavy-duty program to run that happens also to be extremely boring to watch running! It's job, after all, is to run off to your PC's hard disk and scan lots and lots of FLAC files, reading their multiple pieces of metadata and (during a full or differential integrity check, at least) re-computing MD5 hash sums for the audio signal they contain. It's tedious, quite slow and not at all exciting!

It is, accordingly, much more likely that you will want to schedule Niente to do its work in an  unattended, non-interactive manner -and for that sort of thing, rather than navigating your way around Niente's (relatively!) attractive menuing program interface, you'll want to be able to give commands to schedulers such as cron to run things without you needing to be present. For that, Niente provides a set of eight run-time parameters (that is, arguments you can add to the basic 'niente' command), each of which can perform different functions.

Here are the available parameters, in table form:

ParameterPurpose/FunctionMenu Equivalent
--scan-fullWipes the existing tracks from a database and then re-scans default music folder to re-populate it from scratchDatabase -> 2
--scan-newScans the default music folder for new or modified recordings and adds them to the existing databaseDatabase -> 3
--check-fullPerforms a full integrity check (i.e., physical and logical checks for all recordings in the database)Integrity Checks -> 1
--check-differentialPerforms a differential integrity check (i.e., physical & logical checks for recordings with known physical or logical corruption issues)Integrity Checks -> 2
--check-fastPerforms a fast integrity check (i.e., logical check only of recordings already known to the database)Integrity Checks -> 3
--check-artPerforms a new album art check for all recordings known to the databaseIntegrity Checks -> 4
--check-volumePerforms a complete check of possible volume boosts for all recordings in the database Integrity Checks -> 5
--aggstatsGenerates a quick aggregate statistics report and writes it to /tmp/nientestats.csvReporting -> General -> 1

You'll note that these parameters depend on what's configured in the persistent configuration file (Administration menu, Option 1) to determine (a) what database to refresh or check and (b) what music folder is to be used to locate new or modified recordings. Make sure you've configured appropriate values for the 'default music folder' and 'default music database name' parameters before using these run-time parameters, therefore.

The one standout peculiarity in these parameters is the last one: --aggstats. It's odd, because it generates a report (the Quick Aggregate Statistics one) ...and reports are generally only useful if someone is around to read them. Its existence in this list of 'things to do unattended' would therefore seem to be a bit peculiar... and I confess it's there simply for the benefit of this website! You may know that my own listening habits are published on this site ...and that, specifically, the Aggregate Statistics report lists the results of my latest Niente integrity check. I therefore need my dedicated Niente server to generate a Quick Aggregate Statistics report at around midnight each day in unattended mode (it's written out to the /tmp folder) and have that copied across to this site's web server. Niente doesn't handle the file copying (that's cron's job!), but at least the /tmp/nientestats.csv text file is there on disk, ready for the secure copy across the network when it finally kicks in. Incidentally, though the file's extension says it's a comma separated variable file, it's in fact a pipe-separated one: the field separator is a | character, not a comma. It amounts to the same thing regardless of the file extension, anyway!

2.0 Using Runtime Parameters

Run-time parameters are double-dashed keywords added to the basic 'niente' command. For example, if you wanted to schedule a nightly re-scan of your music folders to check if any new recordings had been added to the collection, you might add this to your crontab:

59 23 * * * /usr/bin/niente.sh --scan-new

And if you wanted to do a full integrity check on the first day of each month, you might make this crontab entry:

00 1 1 * * /usr/bin/niente.sh --check-full

...and so on.

Note that the operations triggered by these unattended operations all set the PATH variable to PATH=/usr/local/bin:/usr/bin:/bin:$PATH, so if you are creating your own scripts to automate things, you shouldn't need to worry about setting the PATH variable yourself (which, of course, is usually not set correctly when crontab jobs are run outside of a defined user context).

You can, of course, use the run-time parameters direct from the command line: they aren't only to be used in a crontab, though that's where they make most sense. If you simply want to perform a fast integrity check without having to tap your way through a set of program menus, just type the command niente --check-fast and the task will run immediately. There won't be any program feedback, however: if the recordings scan or integrity check takes hours to complete, you'll simply be staring at a blank screen for that many hours. There'll be no indication of progress, in other words. You can, of course, add an ampersand to the command so that you at least get your terminal back as the operation runs in the background: niente --check-full & will perform a full integrity check but without tying up your terminal session for the duration (just press [Enter] twice after submitting that command to get your terminal back in foreground use whilst the job runs in the background).

Unattended operations will always leave a record of their start and completion times in the Operations Log (visible via the Administration menu, Option 6), so you can always verify that cron jobs are running correctly after the event by looking there.


|[Back to Front Page]|