Skip to main content

Crate rotate_backup

Crate rotate_backup 

Source
Expand description

§Simple utility to rotate backup files

Typical use:

ls *.tar | rotate_backup --output delete | xargs rm -f

§Providing the files

You can either provide files as argument or via stdin:

  • ls *.tar | rotate_backup --output delete | xargs rm -f (requires std feature)
  • rotate_backup --output delete $(ls *.tar) | xargs rm -f

§Selecting output

By default, only file to keep are shown (equivalent to --output keep). Otherwise, you can use --output delete

§Date format

By default, the tool looks for this format: YYYY-mm-dd, but you can select a different format: rotate_backup --format "%Y%m%d" This will parse 20240213 for instance.

§Choosing how much logs are kept

The tool uses an exponential function based on days since the oldest backup. This is inspired from frotate

You can choose the base for the exponent: rotate_backup --base 1.2. Note that only base > 1.0 are accepted.

Modules§

prelude

Structs§

Parameters
Rotate your backup files
PartitionIndex
Index of a partition
PartitionSize
Size of a partition

Traits§

PartitionIterate

Functions§

execute