Difference between revisions of "PyExpireBackups"

From BITPlan Wiki
Jump to navigation Jump to search
Line 15: Line 15:
 
{{pip|PyExpireBackups}}
 
{{pip|PyExpireBackups}}
 
= usage =
 
= usage =
 +
<source lang='bash'>
 +
expireBackups -h
 +
usage: expireBackups [-h] [-d] [--days DAYS] [--weeks WEEKS] [--months MONTHS] [--years YEARS]
 +
                    [--minFileSize MINFILESIZE] [--rootPath ROOTPATH] [--baseName BASENAME] [--ext EXT]
 +
                    [--createTestFiles CREATETESTFILES] [-f] [-V]
 +
 +
Backup expiration based on rules (yearly,monthly,weekly,daily ...)
 +
 +
  Created by Wolfgang Fahl on 2022-04-01.
 +
  Copyright 2008-2022 Wolfgang Fahl. All rights reserved.
 +
 +
  Licensed under the Apache License 2.0
 +
  http://www.apache.org/licenses/LICENSE-2.0
 +
 +
  Distributed on an "AS IS" basis without warranties
 +
  or conditions of any kind, either express or implied.
 +
 +
USAGE
 +
 +
optional arguments:
 +
  -h, --help            show this help message and exit
 +
  -d, --debug          show debug info
 +
  --days DAYS          number of consecutive days to keep a daily backup (default: 7)
 +
  --weeks WEEKS        number of consecutive weeks to keep a weekly backup (default: 6)
 +
  --months MONTHS      number of consecutive month to keep a monthly backup (default: 8)
 +
  --years YEARS        number of consecutive years to keep a yearly backup (default: 4)
 +
  --minFileSize MINFILESIZE
 +
                        minimum File size in bytes to filter for (default: 1)
 +
  --rootPath ROOTPATH
 +
  --baseName BASENAME  the basename to filter for (default: None)
 +
  --ext EXT            the extension to filter for (default: None)
 +
  --createTestFiles CREATETESTFILES
 +
                        create the given number of temporary test files (default: None)
 +
  -f, --force
 +
  -V, --version        show program's version number and exit
 +
</source>
  
 
=tickets=
 
=tickets=

Revision as of 14:00, 2 April 2022

OsProject

OsProject
edit
id  PyExpireBackups
state  active
owner  Wolfgang Fahl
title  Backup expiration based on rules (yearly,monthly,weekly,daily ...)
url  https://github.com/WolfgangFahl/PyExpireBackups
version  0.0.2
description  Expires backup files so save diskspace for unneeded backups - with a pattern of days,weeks,months and years a limit on the total number of backup files is set
date  2022-04-02
since  2022-03-31
until  


Installation

pip install PyExpireBackups
# alternatively if your pip is not a python3 pip
pip3 install PyExpireBackups 
# local install from source directory of PyExpireBackups 
pip install .

upgrade

pip install PyExpireBackups  -U
# alternatively if your pip is not a python3 pip
pip3 install PyExpireBackups -U


usage

expireBackups -h
usage: expireBackups [-h] [-d] [--days DAYS] [--weeks WEEKS] [--months MONTHS] [--years YEARS]
                     [--minFileSize MINFILESIZE] [--rootPath ROOTPATH] [--baseName BASENAME] [--ext EXT]
                     [--createTestFiles CREATETESTFILES] [-f] [-V]

Backup expiration based on rules (yearly,monthly,weekly,daily ...)

  Created by Wolfgang Fahl on 2022-04-01.
  Copyright 2008-2022 Wolfgang Fahl. All rights reserved.

  Licensed under the Apache License 2.0
  http://www.apache.org/licenses/LICENSE-2.0

  Distributed on an "AS IS" basis without warranties
  or conditions of any kind, either express or implied.

USAGE

optional arguments:
  -h, --help            show this help message and exit
  -d, --debug           show debug info
  --days DAYS           number of consecutive days to keep a daily backup (default: 7)
  --weeks WEEKS         number of consecutive weeks to keep a weekly backup (default: 6)
  --months MONTHS       number of consecutive month to keep a monthly backup (default: 8)
  --years YEARS         number of consecutive years to keep a yearly backup (default: 4)
  --minFileSize MINFILESIZE
                        minimum File size in bytes to filter for (default: 1)
  --rootPath ROOTPATH
  --baseName BASENAME   the basename to filter for (default: None)
  --ext EXT             the extension to filter for (default: None)
  --createTestFiles CREATETESTFILES
                        create the given number of temporary test files (default: None)
  -f, --force
  -V, --version         show program's version number and exit

tickets

  1. Issue 8 - alway keep the most recent file
  2. Issue 7 - show summary about kept files
  3. Issue 6 - show debug information
  4. Issue 5 - allow dry run
  5. Issue 4 - allow to specify minimum size of files
  6. Issue 3 - show # age and size of file and total (sum) of file sizes
  7. Issue 2 - allow to create TestFiles via commandLine
  8. Issue 1 - refactor com.bitplan.backup Java solution