API Reference

API documentation for the success-backup-check module.

success_backup_check.__main__.get_parser()[source]

Creates a new argument parser.

success_backup_check.__main__.main(args=None)[source]

Main entry point

Parameters:args – list A of arguments as if they were input in the command line. Leave it None to use sys.argv.
success_backup_check.archiv_files.archiv_files(directory, archive_dir, extension='MDB')[source]

Move Files with the default ending extension from dir to archive_dir :param directory: original dir, where the database is right now :param archive_dir: archiv dir, werhe the database will move to :param extension: file ending name, default “MDB”

Returns:

success_backup_check.archiv_files.search_dir(path, extension)[source]
extension with leading point, for example: ”.MDB”
Parameters:
  • path
  • extension
success_backup_check.check_backup.check_backup(directory, days)[source]
Check a Directory if the last modify date is older than n days
Args:
directory: Directory witch will be checked days: modify time in days
Returns: False –> the dir is out of date
True –> everything is fine
success_backup_check.read_config.main(config_path)[source]

Read the config from the file at config_path and return it’s content :param config_path: str complete path of the config file :type config_path: object

Returns:config content
success_backup_check.set_logging.get_logging_level(logging_level)[source]

Change string into logging level. Example “DEBUG” -> logging.DEBUG

Returns:
logging level
“DEBUG” -> logging.DEBUG “INFO” -> logging.INFO “WARNING” -> logging.WARNING default -> logging.WARNING
Return type:object
success_backup_check.set_logging.set_logging(logging_level, log_file)[source]

Setup logging config to log into terminal & log file. Just execute set_logging(logging_level, log_file) and start of the script & every time when logging will use this config.

Parameters:
  • logging_level – string “DEBUG”, “INFO” or “WARNING”
  • log_file – full path of the log file example: “/var/log/mylog.log”
success_backup_check.set_logging.set_logging_minimal(logging_level)[source]

Set logging minimal logging, just writing log to console without saving it into a file. :param logging_level: string “DEBUG”, “INFO” or “WARNING”

success_backup_check.hdd_smart_test.main(config)[source]

HDD SMART test

Parameters:config (object) – config object from read_config
success_backup_check.hdd_smart_test.send_alert_sendmail(TEXT, failed_drives, config)[source]

HDD SMART test

Parameters:
  • TEXT (object) – Message witch should be send
  • config (object) – config object from read_config