I am trying to schedule a cron job that will purge records in the NetDB database that have not been seen in over 120 days.
I am aware of the following options:
netdbctl.pl -dm -d 120 (delete & confirm all macs and associated ARP and Switchport entries older than -d days)
netdbctl.pl -da -d 120 (delete & confirm all ARP entries older than -d days)
netdbctl.pl -ds -d 120 (delete & confirm all switchport entries older than -d days)
netdbctl.pl -dw -d 120 (delete & confirm all wifi entries older than -d days)
The problem with using these statements in cron is that it expects a 'y' confirmation after it spits out all the records that will be potentially deleted. Is there not an 'accept silently' switch?
I attempted to just use:
dataDeletion.pl -d 120
But this doesn't seem to be reducing the count of records in my tables - given the count of objects using 'netdbctl.pl -st -d 120' before and after the deletion is the same.
Any advice on how I can prune records older than 120 days to prevent my database from becoming too large?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Sorry I didn’t get back to you sooner and you definitely found a bug with that earlier switch combination. Try piping yes into the command, so 'yes | netdbctl.pl -dm -d 120’
If that work, you can wrap it in a shell script and should be good.
I am trying to schedule a cron job that will purge records in the NetDB database that have not been seen in over 120 days.
I am aware of the following options:
netdbctl.pl -dm -d 120 (delete & confirm all macs and associated ARP and Switchport entries older than -d days)
netdbctl.pl -da -d 120 (delete & confirm all ARP entries older than -d days)
netdbctl.pl -ds -d 120 (delete & confirm all switchport entries older than -d days)
netdbctl.pl -dw -d 120 (delete & confirm all wifi entries older than -d days)
The problem with using these statements in cron is that it expects a 'y' confirmation after it spits out all the records that will be potentially deleted. Is there not an 'accept silently' switch?
I attempted to just use:
dataDeletion.pl -d 120
But this doesn't seem to be reducing the count of records in my tables - given the count of objects using 'netdbctl.pl -st -d 120' before and after the deletion is the same.
Any advice on how I can prune records older than 120 days to prevent my database from becoming too large?
I am trying to schedule a cron job that will purge records in the NetDB database that have not been seen in over 120 days.
I am aware of the following options:
netdbctl.pl -dm -d 120 (delete & confirm all macs and associated ARP and Switchport entries older than -d days)
netdbctl.pl -da -d 120 (delete & confirm all ARP entries older than -d days)
netdbctl.pl -ds -d 120 (delete & confirm all switchport entries older than -d days)
netdbctl.pl -dw -d 120 (delete & confirm all wifi entries older than -d days)
The problem with using these statements in cron is that it expects a 'y' confirmation after it spits out all the records that will be potentially deleted. Is there not an 'accept silently' switch?
I attempted to just use:
dataDeletion.pl -d 120
But this doesn't seem to be reducing the count of records in my tables - given the count of objects using 'netdbctl.pl -st -d 120' before and after the deletion is the same.
Any advice on how I can prune records older than 120 days to prevent my database from becoming too large?
Hey Ryan,
Sorry I didn’t get back to you sooner and you definitely found a bug with that earlier switch combination. Try piping yes into the command, so 'yes | netdbctl.pl -dm -d 120’
If that work, you can wrap it in a shell script and should be good.
Let me know and I’ll work on fixing that bug.
Thanks,
Jonathan