Algorithm-History-Levels
view release on metacpan or search on metacpan
lib/Algorithm/History/Levels.pm view on Meta::CPAN
mydb.2017-06-12.sql.gz
mydb.2017-06-11.sql.gz
mydb.2017-06-10.sql.gz
mydb.2017-06-09.sql.gz
...
After a while, your backups grow into tens and then hundreds of dump files. You
typically want to keep certain number of backups only, for example: 7 daily
backups, 4 weekly backups, 6 monthly backups (so you practically have 6 months
of history but do not need to store 6*30 = 180 dumps, only 7 + 4 + 6 = 17). This
is the routine you can use to select which files to keep and which to discard.
You provide the list of histories either in the form of Unix timestamps:
[1497286800, 1497200400, 1497114000, ...]
or in the form of `[name, timestamp]` pairs, e.g.:
[
['mydb.2017-06-13.sql.gz', 1497286800],
['mydb.2017-06-12.sql.gz', 1497200400],
lib/Algorithm/History/Levels.pm view on Meta::CPAN
mydb.2017-06-12.sql.gz
mydb.2017-06-11.sql.gz
mydb.2017-06-10.sql.gz
mydb.2017-06-09.sql.gz
...
After a while, your backups grow into tens and then hundreds of dump files. You
typically want to keep certain number of backups only, for example: 7 daily
backups, 4 weekly backups, 6 monthly backups (so you practically have 6 months
of history but do not need to store 6*30 = 180 dumps, only 7 + 4 + 6 = 17). This
is the routine you can use to select which files to keep and which to discard.
You provide the list of histories either in the form of Unix timestamps:
[1497286800, 1497200400, 1497114000, ...]
or in the form of C<[name, timestamp]> pairs, e.g.:
[
['mydb.2017-06-13.sql.gz', 1497286800],
['mydb.2017-06-12.sql.gz', 1497200400],
( run in 0.320 second using v1.01-cache-2.11-cpan-94b05bcf43c )