Closed MJohnson3150 closed 2 years ago
@MJohnson3150 seems like the Cisco DNA Center API allowed wild card id
.
We could add enforcement for uuid
string as id.
Based on the output above, the delete
function didn't handle id
correctly.
I've made some changes to the code. This will handle the id
correctly and enforce 36 chars for uuid
.
I had 3 backups saved and I ran the following:
ciscodnacbackupctl schedule_purge --interval daily --keep 2 --hour 10:15
When it ran, I got the following output:
Your backups will be deleted daily at 10:15 Deleted backup (backup_id='6') Deleted backup (backup_id='9') Deleted backup (backup_id='1') Deleted backup (backup_id='1') Deleted backup (backup_id='c') Deleted backup (backup_id='2') Deleted backup (backup_id='2') Deleted backup (backup_id='0') Deleted backup (backup_id='-') Cisco DNA Center isn't available - Error: (Error occurs during delete_backup().)
When I think checked my backup folder everything, including the folder itself was gone.
Good job. A backup utility that deletes backups! Wonderful.