Giter Site home page Giter Site logo

multi-volume-backup's Introduction

multi-volume-backup

中文介绍 | English

A smart multi-volume backup script based on tar.

Motivation

I have a large number of files stored in my NAS (OpenMediaVault). To ensure data safety at a low cost, I bought several small-capacity second-hand mechanical hard drives for cold backup (I plan to buy a tape drive for the same purpose in the future). Due to limited hard drive bay space, I can only connect one hard drive at a time via a USB hard drive dock. Therefore, how to backup a large number of files to several small-capacity hard drives (equivalent to portable hard drives) became a problem. My requirements are:

  • Support for multi-volume backup with customizable volume size
  • Automatic detection of disk capacity. If the available space is larger than the volume size, the next volume is automatically stored on the current disk
  • When the disk's available space is insufficient, prompt and wait for me to change the disk
  • Supports incremental backup.
  • While writing the backup volume, streamingly calculate the checksum in the air. Write the corresponding file when each volume is completed, instead of requiring me to read the hard drive data again to calculate the checksum after the backup is completed (operation is very slow)

After some searching, I didn't find any ready-made solutions, so I wrote a script based on tar to accomplish the above functions.

Pre Requisite

In addition to the common commands, the following commands are required:

  • mkfifo
  • tee

Usage

Usage:
  multi-volume-backup backup <source path> <dest path with volume name prefix> <volume size> <snar file path>
  multi-volume-backup restore <first volume path> <dest path> <strip path level>

Note:
  - snar file is used to save filelist to achieve incremental backup
  - strip path level indicates how many levels of paths need to be deleted when extract

Example:
  multi-volume-backup backup /data /mnt/bak/full_backup- 100G /data.snar
  multi-volume-backup restore /mnt/bak/full_backup-1.tar /data 1

multi-volume-backup's People

Contributors

shizhx avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.