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

More efficient backup log #11

Closed
ewxrjk opened this issue Jun 21, 2014 · 3 comments
Closed

More efficient backup log #11

ewxrjk opened this issue Jun 21, 2014 · 3 comments

Comments

@ewxrjk
Copy link
Owner

@ewxrjk ewxrjk commented Jun 21, 2014

$ cat * | wc -c
282855
$ du -ks .
4100    .

i.e. more than 10 times as much space is being used as is really needed. The logs could be combined into one file, or just a few files (e.g. one per host or one per volume).

There is an argument that old-style logs should still be written for a while even when a new-style combined format is written and read, so that after a partial restore of a backup host that reverts an upgrade but does not revert the backup log, backups can continue to work properly without replaying the upgrade. However, pruning cannot work in such a downgrade situation - the new-style data will become inconsistent with the old-style data. Therefore no attempt will be made to support downgrades.

@ewxrjk ewxrjk added this to the 2.0 milestone Jun 21, 2014
@ewxrjk ewxrjk added feature and removed bug labels Jun 21, 2014
@ewxrjk
Copy link
Owner Author

@ewxrjk ewxrjk commented Aug 2, 2014

The current log contains:

  • the date (but not a timestamp)
  • what host/volume was backed up
  • what device is was backed up to
  • an exit status
  • an output string

Thoughts:

  • The above list translates into a SQL table naturally.
  • This seems like an opportunity to upgrade the date to a second-resolution timestamp, allowing for the possibility of more than one backup per day in the future (probably not as part of this issue). Precise timestamps can be recovered from st_mtime during the upgrade process.
@senji-rsbackup
Copy link

@senji-rsbackup senji-rsbackup commented Aug 31, 2014

Looking at my log directory filesizes vary from 19 bytes; containing just OK: device=tenneth from a volume with no backup-hooks and just the output "OK: device=tenneth" to 212241 bytes in the worst case with a hell of a lot of diagnostic output from the backup-hook (the next longest is a mere 25406 bytes).

I guess the diagnostic output from backup-hooks can be stored in an SQL TEXT field; or they could be dumped into a per-day or per-host log file.

@ewxrjk ewxrjk added the performance label Oct 3, 2014
@ewxrjk
Copy link
Owner Author

@ewxrjk ewxrjk commented Oct 12, 2014

The issue11 branch contains an (experimental) implementation using SQLite. I've not deployed it locally yet (though it does pass its tests).

@ewxrjk ewxrjk closed this in c842f3e Dec 31, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants