Git Product home page Git Product logo

offlinebackup's Introduction

offlinebackup

Description

This program is meant to backup smaller online storage to larger offline storage. I use it to backup a 5TB drive to an offline 8TB disk. It uses the remaining 3TB to store older files that have been deleted from the 5TB drive.

Files are copied to the backup and optionally verified. Files that exist on offline storage but don't exist online are preserved until the offline disk becomes full. When the offline disk becomes full, the oldest files are deleted to make room for newer files.

This allows me to store the most recent 5TB of data will storing the next older 3TB offline without me having to manage it manually.

Building

If you have a modern linux system, you should be able to just type make. It has no special dependencies. It shouldn't be hard to build for other unix systems.

It doesn't use mmap (mainly so errors are easier to detect) so should be relatively easy for non-unix systems as well.

make

Quick start

To run this for the first time, try the following commands. This won't write anything to disk.

./offlinebackup --help
./offlinebackup --srcdest . /tmp --dryrun

Usage

Usage: offlinebackup (OPTIONS)

--srcdest A B

Copy files from directory A to B.

If you provide multiple --srcdest arguments, then PLEASE make sure no A's or B's overlap in the filesystem. Also ensure that all B directories are on the same partition so free space calculations make sense.

--interactive

Prompt user before deleting or copying

--not-interactive

disable --interactive (default)

--verbose

Print progress to stdout

--not-verbose

disable --verbose (default)

--memstats

Print memory stats to stdout

--not-memstats

disable --memstats (default)

--verifycopy

Re-read files after writing them to verify contents

--not-verifycopy

disable --verifycopy (default)

--verifymatch

Compare existing destination files to source files

--not-verifymatch

disable --verifymatch (default)

--mismatchquit

Quit out if existing files don't verify, requires/enables --verifymatch (default)

--not-mismatchquit

disable --mismatchquit

--dryrun

Go through the motions but don't delete or copy

--not-dryrun

disable --dryrun (default)

--copyfiles

Copy files from source to destination (default)

--not-copyfiles

disable --copyfiles

--deletemismatch

Delete destination files that don't match source (default)

--not-deletemismatch

disable --deletemistmatch

--deletetofree

Delete oldest destination files to make space on device (default)

--not-deletetofree

disable -deletetofree

--allow0match

Allow 0-byte files on source to match destination files (default)

--not-allow0match

disable --allow0match

--max6months

Truncate source files older than 183 days to 0 bytes

All --maxXXX options also enable --allow0match --verifymatch

--max1year

Truncate source files older than 366 days to 0 bytes

All --maxXXX options also enable --allow0match --verifymatch

--max18months

Truncate source files older than 548 days to 0 bytes

All --maxXXX options also enable --allow0match --verifymatch

--max2years

Truncate source files older than 731 days to 0 bytes

All --maxXXX options also enable --allow0match --verifymatch

--nomaxage

Do not truncate source files (default)

--nomargin

Attempt copying even if it looks like we'll run out of space

--verify_mode

Shortcut for --not-copyfiles --verbose --verifymatch --not-deletemismatch --allow0match

--fullbackup_mode

Shortcut for --verbose --verifycopy --verifymatch --allow0match --max6months

offlinebackup's People

Contributors

sanjayrao77 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.