cli()
Implements the command-line interface for the
cback-span script.
Essentially, this is the "main routine" for the cback-span
script. It does all of the argument processing for the script, and then
also implements the tool functionality.
This function looks pretty similiar to
CedarBackup2.cli.cli(). It's not easy to refactor this
code to make it reusable and also readable, so I've decided to just
live with the duplication.
A different error code is returned for each type of failure:
-
1: The Python interpreter version is < 2.3
-
2: Error processing command-line arguments
-
3: Error configuring logging
-
4: Error parsing indicated configuration file
-
5: Backup was interrupted with a CTRL-C or
similar
-
6: Error executing other parts of the script
-
- Returns:
-
Error code as described above.
Note: This script uses print rather than logging to the INFO level, because
it is interactive. Underlying Cedar Backup functionality uses the logging
mechanism exclusively.
|