backend.globaleaks.utils.backup

Module Contents

Functions

backup_name(id, timestamp) Return the filename for the backup
backup_type(date) Analyze the type of the current backup date
get_records_to_delete(d, w, m, records) Return which backups records need to be deleted given a backup configuration
backend.globaleaks.utils.backup.backup_name(id, timestamp)[source]

Return the filename for the backup :param id: a unique identifier identifying the instance :param timestamp: the timestamp of the current date :return: The filename for a new backup file

backend.globaleaks.utils.backup.backup_type(date)[source]

Analyze the type of the current backup date :param date: A date :return: Return if the backup is a daily, weekly or monthly backup

backend.globaleaks.utils.backup.get_records_to_delete(d, w, m, records)[source]

Return which backups records need to be deleted given a backup configuration :param d: A number of daily backups to keep :param w: A number of weekly backups to keep :param m: A number of monthly backups to keep :param records: A list of the current backups records :return: A set of records that need to be deleted according to the retention policy