Git Product home page Git Product logo

glacier-rsync's Introduction

AWS Glacier Rsync Like Utility

Rsync like utility to back up files and folders to AWS Glacier. Utility can compress files and store on Glacier. Archive ids will be stored in an sqlite database.

You have to log in to aws with aws cli and create a glacier vault beforehand.

Run params:

$ grsync --help
usage: grsync version 0.3.5 [-h] [--loglevel {CRITICAL,FATAL,ERROR,WARN,WARNING,INFO,DEBUG,NOTSET}] [--db db] --vault vault --region region [--compress COMPRESS] [--part-size PART_SIZE] [--desc desc] src

Rsync like glacier backup util

positional arguments:
  src                   file or folder to generate archive from

optional arguments:
  -h, --help            show this help message and exit
  --loglevel {CRITICAL,FATAL,ERROR,WARN,WARNING,INFO,DEBUG,NOTSET}
                        log level (default: INFO)
  --db db               database file to store sync info (default: glacier.db)
  --vault vault         Glacier vault name (default: None)
  --region region       Glacier region name (default: None)
  --compress COMPRESS   Enable compression. Only zstd is supported (default: False)
  --part-size PART_SIZE
                        Part size for compression (default: 1048576)
  --desc desc           A description for the archive that will be stored in Amazon Glacier (default: None)

If compression is enabled, file will be read and compressed on the fly and uploaded to glacier multipart.

Sqlite database scheme:

CREATE TABLE 
    sync_history
(id          integer primary key,
 path        text,		/* full path of the backed up file */
 file_size   integer,	/* size of the file */
 mtime       float,		/* modification time */
 archive_id  text, /* archive id generated by glacier */
 location    text, /* archive url generated by glacier */
 checksum    text, /* checksum of the archive generated by glacier*/
 compression text, /* compression algorithm used. NULL if none */
 timestamp   text /* backup timestamp */
);

Do not lose your database

Currently, there is no way to rebuild it from aws inventory.

Known Issues

  • Glacier supports 1024 bytes of description, and I'm currently putting a description in this format:
grsync|abs_file_path|size|mtime|user_desc

Which is not posix compatible since there is no limit to the filename or full path. I can put a metadata in front of every archive but this means that the data can be recovered only with the same tool

  • If the absolute file path changes, grsync will treat it as a different file and re-upload
  • Currently, there is no way to recover the local database, but you can download the inventory with aws cli and download individual files with the help of description. I maybe create a tool to re-create the local db with inventory retrieval, but the first issue has to be addressed before.

glacier-rsync's People

Contributors

cagdasbas avatar

Stargazers

Louis Martin avatar Nick Maksak avatar Takashi Kanemoto avatar Fra avatar Phil avatar Thomas Lewis avatar Pierce Bartine avatar Evan B avatar Clifton Dobrich avatar

Watchers

James Cloos avatar  avatar Bruno de Medeiros avatar Nick Maksak avatar Natacha avatar

Forkers

milancados

glacier-rsync's Issues

Invalid Content-Range: Error

Hi, I came across your tool and gave it a test drive.
It was really simple to install. However, I continue to receive this error when using the tool.

Invalid Content-Range: bytes 290527679-290527678/*

File upload fails with error: Invalid Content-Range

# ~/.local/bin/grsync -h
usage: grsync version 0.3.6

Attempting to backup a ~900M zip file fails with:

2021-06-16 13:25:12,689 - backup_util._backup:228 - ERROR - An error occurred (InvalidParameterValueException) when calling the UploadMultipartPart operation: Invalid Content-Range: bytes 909994937-909994936/*

Based on the error message and the file size, the range in question appears to be incorrect.

File details in question:

root@git:/usr/local/gitea/backup# file gitea-dump-1623848969.zip 
gitea-dump-1623848969.zip: Zip archive data, at least v2.0 to extract
root@git:/usr/local/gitea/backup# ls -l gitea-dump-1623848969.zip 
-rw------- 1 xxx sysadmin 909994937 Jun 16 13:10 gitea-dump-1623848969.zip

Thanks for taking a look. ๐Ÿ‘

update

hello
what is the status of that tool / or it was replaced by something other?
does it support glacier deep archive?

thanks!

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.