Skip to content

rafaltrojniak/backuprotate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

84 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Table of Contents

About

This project aims to solve simple problem : backup rotating.

How it should work

Simple using scenario :

On local host

  • For new backup you create directory in pickup dir
  • New backup is being made in that directory. Multiple files are allowed
  • Checksums are filled ( option -f )
  • Backup i locally rotated to backup dirs

On remote host

  • Backups are transferred to remote host pickup dir (use rsync, scp or other)
  • Checksums are calculated, only verified backups are being processed option -w)
  • Backups are rotated on remote host

Pickup dir

New directories consisting of backups should be put into backups/pickup dir. Directory name should be formatted as ISO8601 time. This will be used as backup creation time during processing.

Storing dirs

In conifg.php you can configure many storing dirs. Directories from the pickup dir will be linked to the storing dirs according to storing-dir configuration.

Storing dir configuration

  • rotate - rotation algorithm
  • rotate_opts - rotation algorithm configuration options ( depending on the algorithm )
  • clean - cleaning algorithm
  • clean_opts - cleaning algorithm configuration (depending on the algorithm)
  • copier - Copier algorithm name
  • copier_opts - Copier algorithm configuration

Rotating algorithm

grouped
This algorithm groups backups by token based on creation time. This token is configured by group option. For every group the oldest backup is picked. If there is backup in pickup dir older than actual backup, it is also picked. Value of group configuration is used as param to date()] function. Examples :
  • 'Y' yearly
  • 'Ym' monthly
  • 'YW' Weekly
  • 'Ymd' daily
  • 'YmdH' Hourly

Cleaning algorithm

count
Throws out all the backups over the count value. It throws oldest backups. _IMPORTANT_ If you have duplicates in group rotating (many backups in the same group) it can rotate oldest backups and throw them out.

Cloning/Copying algorithm

Copier
This algorithm just copies all of the file sto new destination
Linker
This algorithm makes hard link for each file from the original directory to the new one.
GPGCrypter
This algorithm lets encrypt backupdir while cloning. It encrypts each file one-by-one Supported options: - directOpen - Tre if file opening should be done direct from the gpg tool - enc_key - ID of the key to use while encrypting

TODO

Wish list

  • Signing / checking signatures on Checksums file ( GPG - signatures)
  • Running backup checks after pickup
  • Scheduling additional checks after some time
garbagedate()] function.

Examples :

  • 'Y' yearly
  • 'Ym' monthly
  • 'YW' Weekly
  • 'Ymd' daily
  • 'YmdH' Hourly

Cleaning algorithm

count

Throws out all the backups over the count value. It throws oldest backups. _IMPORTANT_ If you have duplicates in group rotating (many backups in the same group) it can rotate oldest backups and throw them out.

Cloning/Copying algorithm

Copier

This algorithm just copies all of the file sto new destination

Linker

This algorithm makes hard link for each file from the original directory to the new one.

GPGCrypter

This algorithm lets encrypt backupdir while cloning. It encrypts each file one-by-one Supported options: - directOpen - Tre if file opening should be done direct from the gpg tool - enc_key - ID of the key to use while encrypting

TODO

Wish list

  • Signing / checking signatures on Checksums file ( GPG - signatures)
  • Running backup checks after pickup
  • Scheduling additional checks after some time

About

Backup rotating tool

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages