Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LMT should provide a utility to clear old raw data #22

Open
haasken opened this issue Oct 24, 2013 · 0 comments
Open

LMT should provide a utility to clear old raw data #22

haasken opened this issue Oct 24, 2013 · 0 comments

Comments

@haasken
Copy link

haasken commented Oct 24, 2013

It would be useful if LMT had a script, an option to lmtsh, or an option to lmt_agg.cron that would clear raw data which is older than a certain date. Perhaps this could be in the form of a shell script that can be run manually or set up to run as a cron job.

I was thinking a shell script that executes a bunch of MySQL commands like this one would do the trick:

mysql -p$(cat /etc/lmt/rwpasswd) -e "DELETE MDS_OPS_DATA 
FROM MDS_OPS_DATA INNER JOIN TIMESTAMP_INFO 
ON MDS_OPS_DATA.TS_ID=TIMESTAMP_INFO.TS_ID 
WHERE TIMESTAMP < '$TIMESTAMP';"

Of course the actual shell script would need options for which data tables to clear and the time frame to clear. @morrone please advise whether this is a reasonable addition to LMT. If so, I will create this script and its documentation and issue a pull request.

Other options considered:

  1. Add this functionality to lmt_agg.cron. This might be misleading because this script is for aggregation, not clearing. On the plus side, it could make sure that data which has not been aggregated yet is not deleted. It probably doesn't need to be implemented in Perl though.
  2. Add this functionality to lmtsh. This would have to be done manually and not as a cron job. However, there is already some clearing functionality here with the "clr" command.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant