Menu

NetDB Data Deletion in cron

Help
2017-05-09
2017-05-09
  • Ryan Mahoney

    Ryan Mahoney - 2017-05-09

    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?

     
    • Jonathan Yantis

      Jonathan Yantis - 2017-05-09

      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

      On May 9, 2017, at 1:05 PM, Ryan Mahoney rjmahoney@users.sf.net wrote:

      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?

      NetDB Data Deletion in cron https://sourceforge.net/p/netdbtracking/discussion/939989/thread/608871e8/?limit=25#f2a7
      Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/netdbtracking/discussion/939989/ https://sourceforge.net/p/netdbtracking/discussion/939989/
      To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/ https://sourceforge.net/auth/subscriptions/

       

Log in to post a comment.