2017 © Pedro Peláez
 

project c14-backup-tool

Backup tool for cheap C14 storage provided by online.net. Support encryption, diff backups and backup rotation. Description about storage https://www.online.net/en/c14

image

thesaturn/c14-backup-tool

Backup tool for cheap C14 storage provided by online.net. Support encryption, diff backups and backup rotation. Description about storage https://www.online.net/en/c14

  • Sunday, April 8, 2018
  • by thesaturn
  • Repository
  • 1 Watchers
  • 1 Stars
  • 3 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 8 Versions
  • 0 % Grown

The README.md

C14 Backup Tool

Backup tool for cheap C14 storage provided by online.net. Support encryption, diff backups and backup rotation. Description and prices here: https://www.online.net/en/c14., (*1)

Описание на русском, (*2)

Inspired by BackInTime, (*3)

Features

  • Multi profile configuration
  • Exclude folders and files
  • Client-side encryption
  • Backup rotations

Requirements

PHP >= 5.6, (*4)

rsync, (*5)

encfs (+encfstools), (*6)

sshfs, (*7)

ssh, (*8)

ssh-keygen, (*9)

Optional dependence

cron, (*10)

composer, (*11)

fabiang/xmpp, (*12)

Installation

Without xmpp logs and composer, (*13)

git clone https://github.com/TheSaturn/C14BackupTool.git
cd C14BackupTool
cp config.example.php config.php

If you want get logs by xmpp:, (*14)

composer create-project thesaturn/c14-backup-tool
cp config.example.php config.php

Terminology

C14 — Storage type, (*15)

Safe — Name of archives group in C14, (*16)

Archive — Contains your files, (*17)

Configuring

All possible options described in config.example.php. Below some tips * config.php must return array with profiles return [...] * Every profile has its name, (*18)

return [
    'default' => [...],
    'books2' => [...],
    'books3' => [...],
    'books4' => [...],
];
  • All paths must be absolute to avoid possible errors

Usage

Command line usage: php /path/to/main.php profileName 1. Register to online.net 2. Add your debit/credit card 3. Generate ssh keys (if you don't have them) ssh-keygen 3. Edit config.php as you like 4. Test your configuration 5. Add backup tool to cron 6. Time to time look through archives in safe lists to check size of archives, (*19)

Notices

  • Diff backups created only in one archive. So you can always delete any archive without corrupting others
  • Storage API is a quite slow and not stable. That is why code try several times to do operations and have sleep() function to wait, while operations will be applied.
  • Archive creates for 7 days, but tool make backups only for 6 days since archive created.
  • Encfs config file also copied to archive. So you don't need to save it somewhere else.
  • If all rotation options is to false, all backups will be saved.
  • If encryption enabled, exclude working with only absolute paths, regex is not available

Not implemented yet

  • Better config validation
  • Dependencies checking
  • Tests

Algorithm

  1. Send a message about backup starting "Backup started for safe"
  2. Find a safe with safe name (set up in config)
  3. Find an archive in the safe to store backups
  4. Create necessary folders
  5. Mount encfs (encrypted view of the root FS)
  6. Encrypt included and excluded file names (for rsync)
  7. Mount the archive (sshfs)
  8. Clean up backup_temp folder (if last backup was unsuccessful)
  9. Copy hard links from the last backup folder
  10. Send the message "YAY! The real backuping is starting!"
  11. rsync
  12. rename backup_temp to C14ABT/$date
  13. Write date of successful backup to description of the archive
  14. Send "Backup success."
  15. Unmount sshfs and encfs

The Versions

08/04 2018

dev-master

9999999-dev

Backup tool for cheap C14 storage provided by online.net. Support encryption, diff backups and backup rotation. Description about storage https://www.online.net/en/c14

  Sources   Download

MIT

The Requires

 

by Avatar thesaturn

08/04 2018

1.1.1

1.1.1.0

Backup tool for cheap C14 storage provided by online.net. Support encryption, diff backups and backup rotation. Description about storage https://www.online.net/en/c14

  Sources   Download

MIT

The Requires

 

by Avatar thesaturn

02/08 2017

1.1

1.1.0.0

Backup tool for cheap C14 storage provided by online.net. Support encryption, diff backups and backup rotation. Description about storage https://www.online.net/en/c14

  Sources   Download

MIT

The Requires

 

by Avatar thesaturn

02/06 2017

1.0.4

1.0.4.0

Backup tool for cheap C14 storage provided by online.net. Support encryption, diff backups and backup rotation. Description about storage https://www.online.net/en/c14

  Sources   Download

MIT

The Requires

 

by Avatar thesaturn

02/06 2017

1.0.3

1.0.3.0

Backup tool for cheap C14 storage provided by online.net. Support encryption, diff backups and backup rotation. Description about storage https://www.online.net/en/c14

  Sources   Download

MIT

The Requires

 

by Avatar thesaturn

30/03 2017

1.0.2

1.0.2.0

Backup tool for cheap C14 storage provided by online.net. Support encryption, diff backups and backup rotation. Description about storage https://www.online.net/en/c14

  Sources   Download

MIT

The Requires

 

by Avatar thesaturn

30/03 2017

1.0.1

1.0.1.0

Backup tool for cheap C14 storage provided by online.net. Support encryption, diff backups and backup rotation. Description about storage https://www.online.net/en/c14

  Sources   Download

MIT

The Requires

 

by Avatar thesaturn

29/03 2017

1.0.0

1.0.0.0

Backup tool for cheap C14 storage provided by online.net. Support encryption, diff backups and backup rotation. Description about storage https://www.online.net/en/c14

  Sources   Download

MIT

The Requires

 

by Avatar thesaturn