glacier_utils

command module
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 14, 2020 License: Apache-2.0 Imports: 1 Imported by: 0

README

Glacier_utils

This command has been written to simplify the process of retrieving files from AWS glacier. By using Go you don't need to install aws-cli on your server.

Usage

you need valid aws creadentials stored in ~/.aws/credentials or in environment variables.

The only command implemented is getFiles, you can retrieve the help as follow:

$ glacier_utils getFiles -h

  Retrieve files from glacier by requesting defrost and download if needed
  
  Usage:
    glacier_utils getFiles [flags]
  
  Flags:
    -b, --bucketName string     name of de bucket to dowload files from
    -r, --bucketRegion string   region where the bucket is located (default "eu-west-1")
        --defrost               defrost files that matches
    -d, --dir string            directory where to save the downloaded files (default ".*")
        --download              download files that matches
    -h, --help                  help for getFiles
    -p, --prefix string         prefix to use to filter result on AWS side ( this increase speed )
    -x, --regexpFilter string   regular expression used to filter files (default ".*")

My recommendation is to run the command with prefix and regexpFilter in order to check the files that will be affected:

$ glacier_utils getFiles --bucketRegion "eu-west-1" --bucketName "mybucket" --prefix 'date_2020-' --regexpFilter "date_2020-[0-1][0-9]-01/.*"         

#################################################
## Files matching pattern:
#################################################
GLACIER  -  date_2020-01-01/mybackup.bkp
GLACIER  -  date_2020-02-01/mybackup.bkp
GLACIER  -  date_2020-03-01/mybackup.bkp
GLACIER  -  date_2020-04-01/mybackup.bkp
GLACIER  -  date_2020-05-01/mybackup.bkp
GLACIER  -  date_2020-06-01/mybackup.bkp

And then run the commad with the --defrost and --download parameters:

#################################################
## Files matching pattern:
#################################################
GLACIER  -  date_2020-01-01/mybackup.bkp
GLACIER  -  date_2020-02-01/mybackup.bkp
GLACIER  -  date_2020-03-01/mybackup.bkp
GLACIER  -  date_2020-04-01/mybackup.bkp
GLACIER  -  date_2020-05-01/mybackup.bkp
GLACIER  -  date_2020-06-01/mybackup.bkp

#################################################
## Restoring Objects
#################################################
GLACIER  -  date_2020-01-01/mybackup.bkp
GLACIER  -  date_2020-02-01/mybackup.bkp
GLACIER  -  date_2020-03-01/mybackup.bkp
GLACIER  -  date_2020-04-01/mybackup.bkp
GLACIER  -  date_2020-05-01/mybackup.bkp
GLACIER  -  date_2020-06-01/mybackup.bkp
Skipping download since some item isn't restored yet

Please note that the above command does not download files until all restore requests are complete.

Documentation

Overview

Copyright © 2020 roviluca

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL