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

New Automated Backup Script #1

Open
preaction opened this issue Apr 21, 2016 · 1 comment
Open

New Automated Backup Script #1

preaction opened this issue Apr 21, 2016 · 1 comment

Comments

@preaction
Copy link
Member

The current backup script, to save time, only backs up the last few million reports. These are there reports that are most likely to change. However, updating which millions of reports to backup is a manual process.

We need a program to run to backup from a database. On certain tables in that database, we need to be able to only back up the last N rows (thousand, million, etc), and we need those backup files to contain a certain number of rows. This should probably be configurable in a file, and the backup program then run from a cron job.

So, the files that this thing produces should likely look like this:

# 10M - 11M reports in "cpantesters.metabase" table
cpantesters-metabase-10M-20160101.sql.gz
# 11M - 12M reports in "cpantesters.metabase" table
cpantesters-metabase-11M-20160101.sql.gz
# 12M + reports (since we only have 12.4 million in this example)
cpantesters-metabase-12M-20160101.sql.gz

# The entire "cpantesters.statistics" table on 2016-01-01
cpantesters-statistics-20160101.sql.gz

If a file cannot be written due to disk space issues, the entire backup should be deleted and a nastygram printed to STDERR, as it is invalid.

@preaction
Copy link
Member Author

The backup program should only keep a given number of full backups available. This was the main problem we were having with the current backup.

preaction added a commit to cpan-testers/cpantesters-deploy that referenced this issue May 15, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant