Skip to content

myback glacier usage

p53 edited this page Aug 14, 2015 · 2 revisions

SYNOPSIS

myback-glacier [--help|-h] [--action|-a] action [--dir|-d] path [--loc|-l] location_of_mysql_dir [--time|-t] time [--id|-i] id_of_backup [--format|f] output format

DESCRIPTION

Utility for uploading and managing backups between host and glacier

OPTIONS

   --help|-h
                   prints help for utility

   --action|-a
               Can be one of these:

               sync
                   uploads all files, which are not yet in glacier, in dir recursively to the
                   glacier
                   requires: dir

               get
                   retrieves, downloads files with uuid as supplied id to the directory
                   specified in location parameter/get and restores backup to location/restore
                   requires: dir, id, location

               clean
                   select all entries which have backup start older than supplied time,
                   checks if entries present on filesystem, if yes check if present
                   in glacier table, if yes delete from database and also from filesystem,
                   if not present on fs nor in glacier delete just entry in database
                   requires: dir, time

               clean_rmt
                   select all entries from glacier table which have backup start older
                   than supplied time, delete them from glacier table
                   requires: dir, time

               clean_journal
                   selects all archive entries from journal table, which have delete entries
                   older than supplied time and are not present in glacier table
                   requires: dir, time

               list
                   lists backups, which should be present in glacier
                   requires: dir, format

   --dir|-d
               This is path to the directory, where backups are present

   --loc|-l
               this is directory path where backups are downloaded

   --id|-i
               every backup has uniq uuid

   --time|t
               number of days/hours/minutes in one of format: 1d or 24h or 1440m

   --format|f
               output format, currently supported

               tbl - table
               lst - list

EXAMPLES

We have host myhost and backups in /backups folder. Every action with glacier is logged to journal.

Command uploads all content of directory /backups to the glacier. It is uploading just in case files are not present already in glacier and their mtime is not different:

myback-glacier -a sync -d /backups

command retrievs, waits for retrieve end (in glacier it takes approx. 4+ hours) and downloads backup with uuid ffaafb60-158e-11e5-a6ea-0ef14e8692d9 to directory /glacier/download/get and then restores to /glacier/download/restore:

myback-glacier -a get -d /backups -l /glacier/download -i ffaafb60-158e-11e5-a6ea-0ef14e8692d9

command cleans local history of remote backups and remove those backup from filesystem, for entries older than 7200 hours, check clean method for details (it is not so simple):

myback-glacier -a clean -d /backups -t 7200h

command cleans local history of glacier backups and remove those backups from glacier, for entries older than 30 days, please check cleam_rmt for details:

myback-glacier -a clean_rmt -d /backups -t 30d

command cleans journal entries older than 90 days, again it is not so simple, please check clean_journal method description:

myback-glacier -a clean_journal -d /backups -t 90d

command lists backups which should be present now in glacier:

myback-glacier -a list -d /backups -f tbl

Clone this wiki locally