10-28-2023 02:39 AM
Has anyone found a simple way to automate the deletion of old DNAC Backups?
Our DNAC is set to backup to a Linux server each night, however, unless we remember to regularly go to the DNAC backup page and delete old backups the Linux server eventually runs out of disk space, and then the DNAC backups fail! As the DNAC Backup process doesn't send success/failure notifications the failures can go unnoticed for prolonged periods.
It would be fairly simple to create a LINUX CRON job to delete all the files older than (for example) 14 days, but I'm not sure if this would then cause a problem with the DNAC GUI which may not reflect they were deleted??
I'd be interested to see how others have solved the problem...
10-30-2023 02:25 PM - edited 10-30-2023 02:28 PM
You can clear old backups on your storage/backup server without issues. The deleted backups will automatically disappear from the DNAC UI without further intervention.
This tool (by Cisco employees) can be used to achieve what you are looking for: https://github.com/cskoglun/ciscodnacbackupctl
01-29-2024 01:13 AM
Hi Everyone!
I have been told that if I click on the "Delete" button in DNAC at section "Backup and Restore". then the system does not delete the file from the server. Is it really true ?
02-05-2024 10:02 PM
I have observed my files actually being deleted on the backup server when deleting from the GUI. Maybe it depends on catalyst server version and the file server?
02-05-2024 10:18 PM
I created a python script that deletes backups that are older than specified period of days.
Modify to suit your tastes. I am not a programmer by any stretch of the imagination, I just make things to work for me
I have 2 catalyst centre boxes now, so I do need to modify the URL to be a variable I can parse from CLI. I could also modify it to work from CRON on schedule, but I like to see what is happening with things sometimes so I just run this once a month right now.
I did create one that automates backups, since in the GUI you can only have one scheduled backup. I have a weekly full scheduled backup from the gui, then using API I have a nightly one that doesn't include assurance data.
02-06-2024 10:34 PM
For Backup Retention & Automated deletion of older backups...
- In there current releases of the Catalyst Center OnPrem HW (P1.7), Backup Retention (in number of backups) is "not" available.
- In release 2.3.7.4 Catalyst Center on ESXi (P3.0), Backup Retention (in number of backups) is available. You can set the value from 3 to 60 backups and then the janitor cleanup is at 12am each day.
In a future release, both platforms will be a Platform 3.0 which will bring a lot of these features together. For your next question, which release? I will let the PMs answer that one as they have insights to the roadmap.
So the current method for deleting older or unwanted backups for the Catalyst Center OnPrem HW is to manually delete from the Admin UI one by one. Using scripts or removing on the remote file server has a potential for error. And this would not be optimal for your production data backups.
10-22-2024 11:52 PM
Hi, where is this set up? I have version 2.3.7.6 but do not see the function under System/Backup & Restore to automatically delete older system backups.
10-23-2024 06:15 AM
There are two versions of 2.3.7.6, the one for on-prem and the one for ESXi Virtual Appliance. The ESXi Virtual Appliance is the one that supports automatic backup retention. The on-prem (physical appliance) does not currently support it.
02-12-2024 02:23 AM
I have used this tool developed and maintained by some Cisco guys for a while: https://github.com/cskoglun/ciscodnacbackupctl
06-04-2024 04:54 AM
might be cool stuff, but we cannot use it on our hardened repos(
10-07-2024 07:53 AM
Hi,
the problem with that daemon is that it wont start by itself after a reboot. So I wrote a python3 script that will check the status and if necessary start the daemon:
import subprocess
def check_daemon_status():
try:
result = subprocess.run(['/home/myuser/.local/bin/ciscodnacbackupctl', 'daemon', 'status'], capture_output=True, text=True)
output = result.stdout
if "dead" in output:
print("ciscodnacbackupctl daemon is dead. Restarting...")
restart_result = subprocess.run(['/home/myuser/.local/bin/ciscodnacbackupctl', 'daemon', '--keep', '10', 'start'], capture_output=True, text=True)
if restart_result.returncode == 0:
print("ciscodnacbackupctl daemon restarted successfully.")
else:
print("Failed to restart ciscodnacbackupctl daemon:", restart_result.stderr)
else:
print("ciscodnacbackupctl daemon is running fine.")
except Exception as e:
print(f"Error occurred: {e}")
if __name__ == "__main__":
check_daemon_status()
The script is started hourly by cron:
0 * * * * /usr/bin/python3 /home/myuser/ccc-backup-management/ccc-housekeeping-daemon-check.py
Please adjust the path(s) according to your setup.
Hth
10-09-2024 07:32 AM
Finally i made it w/o python with just a bash-script running from crone. it btw keeps script applied after repo reboots .
10-09-2024 06:11 AM
As Tomas mentioned, the only supported method is through the UI of Catalyst Center. If you choose to use a script, regardless if it was developed by some Cisco guys or created internally with python, TAC does not support that. So, if you encounter a problem with your backups or when trying to restore due to those tools, you will not be able to get support on fixing this.
10-09-2024 07:33 AM
so is declared feature is available on the 2.3.7.6?
10-09-2024 08:36 AM
With Version 2.3.7.6-70319 via SSH? Nope!
Local hdd on ESXI? Yes
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide