Skip to content

Rotate backups using exponentially-growing periods.

Notifications You must be signed in to change notification settings

vitlav/pylog2rotate

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python port of log2rotate

This is a rewrite of the log2rotate tool by Chris Forno. It provides the same command line interface as the original and adds:

  • keeping an arbitrary number of recent backups before applying the exponential rotation algorithm (--skip)
  • limited fuzzy matching in case of missing backups (--fuzz)
  • support for arbitrary date formats (--format)
  • a better detection of situations where applying the rotation algorithm might be dangerous (--unsafe)
  • a Python module providing a Log2Rotate class that can be used to apply the exponential rotation algorithm to arbitrary Python objects for which subtraction and comparison operators can be defined.

See http://jekor.com/log2rotate

Fuzzy matching produces better results than --unsafe in case occasional backups are missing from the series (due to backup server down-time, for example). With fuzzy matching, an older backup is selected for long-term keeping if the exact backup selected by the log2rotate algorithm is missing.

License

Copyright (C) 2015 Tomaz Solc <tomaz.solc@tablix.org>

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

About

Rotate backups using exponentially-growing periods.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%