Dears, please share with us strong details about :
1- Number of Backups , ERP-Next website >> setup >> System Settings >> Number of Backups >> 5
its meaning will delete the older of 5 backups?
2- How to keep history for some days.
3- Is the mentioned setup working with manual and auto backups?
4- From your code, the old backups will remove daily, whether the keep_backup_for_hours
option is not specified, please more details about keep_backup_for_hours
option.
def scheduled_backup(older_than=6, ignore_files=False, backup_path_db=None, backup_path_files=None, backup_path_private_files=None, force=False):
"""this function is called from scheduler
deletes backups older than 7 days
takes backup"""
odb = new_backup(older_than, ignore_files, backup_path_db=backup_path_db, backup_path_files=backup_path_files, force=force)
return odb
def new_backup(older_than=6, ignore_files=False, backup_path_db=None, backup_path_files=None, backup_path_private_files=None, force=False):
delete_temp_backups(older_than = frappe.conf.keep_backups_for_hours or 24)
odb = BackupGenerator(frappe.conf.db_name, frappe.conf.db_name,\
frappe.conf.db_password,
backup_path_db=backup_path_db, backup_path_files=backup_path_files,
backup_path_private_files=backup_path_private_files,
db_host = frappe.db.host)
odb.get_backup(older_than, ignore_files, force=force)
return odb
Thanks.