![]() ![]() # Enforce max backups and delete oldest if there will be too many after the new backup If x.is_file() and x.suffix = '.zip' and x.name.startswith('backup-') # Get the amount of past backup zips in the backup directory already # Validate the backup directory exists and create if requiredīackup_directory_path.mkdir(parents=True, exist_ok=True) Object_to_backup_path = Path(OBJECT_TO_BACKUP)īackup_directory_path = Path(BACKUP_DIRECTORY)Īssert object_to_backup_path.exists() # Validate the object we are about to backup exists before we continue MAX_BACKUP_AMOUNT = 5 # The maximum amount of backups to have in BACKUP_DIRECTORY OBJECT_TO_BACKUP = '/home/etre/test/' # The file or directory to backupīACKUP_DIRECTORY = '/home/etre/test-backup/' # The location to store the backups in I use this script to make zipped backup of important folder but because after 5th backup files is moves to Recycle Bin and show to everyone I am looking for setpassword opinion to protect deleted zips or even better delete old zips but permanently (not move in Recycle Bin).
0 Comments
Leave a Reply. |