aboutsummaryrefslogtreecommitdiff
path: root/lib/App
AgeCommit message (Collapse)AuthorFiles
2018-12-17Update docs.Sergey Poznyakoff3
2018-12-17Optionally take credentials from the instance storeSergey Poznyakoff6
* lib/App/Glacier.pm: Version 2.00.90 * lib/App/Glacier/Bre.pm: Try to get region and credentials from the instance store, if not explicitly supplied. * lib/App/Glacier/Signature.pm: New file. * lib/App/Glacier/Command.pm: Don't bail out if the default configuration file does not exist. However, explicitly supplied (via the --config option or GLACIER_CONF envvar) file must exist. * lib/App/Glacier/DB/GDBM.pm: Fix creation of missing directories. * lib/App/Glacier/Job/InventoryRetrieval.pm: Bugfixes.
2018-12-16Minor fixSergey Poznyakoff1
2018-12-16Use LastInventoryDate from the vault description to control directory validitySergey Poznyakoff4
* lib/App/Glacier/Command.pm (directory): Pass pointer to glacier to the directory constructor. * lib/App/Glacier/Command/Put.pm (_upload): Don't call directory invalidate. * lib/App/Glacier/Command/Sync.pm (sync): Likewise. * lib/App/Glacier/Directory.pm (new): Expect a pointer to glacier as 3rd argument. (vault, glacier): New methods. (is_dirty, clear_dirty, invalidate): Remove methods. (status): Use LastInventoryDate from the vault description to decide the directory status.
2018-12-16Provide intermediate Glacier APISergey Poznyakoff16
The class App::Glacier::Bre is a wrapper over Net::Amazon::Glacier that fixes several bugs in the parent class and provides graceful error handling using the App::Glacier::HttpCatch interface. For each Net::Amazon::Glacier method, it offers a corresponding method with capitalized name, that, instead of croaking on errors, sets up the error status and returns. Error status of the last method call is available via methods lasterr and last_error_message. Additionally, the methods of Net::Amazon::Glacier are available under their original names. * lib/App/Glacier/Bre.pm: New file. * lib/App/Glacier/Command.pm (glacier_eval,lasterr) (last_error_message): Remove. Use Bre API. * lib/App/Glacier/Command/CreateVault.pm: Use Bre API. * lib/App/Glacier/Command/DeleteFile.pm: Likewise. * lib/App/Glacier/Command/DeleteVault.pm: Likewise. * lib/App/Glacier/Command/Get.pm: Likewise. * lib/App/Glacier/Command/Jobs.pm: Likewise. * lib/App/Glacier/Command/ListVault.pm: Likewise. * lib/App/Glacier/Command/Periodic.pm: Likewise. * lib/App/Glacier/Command/Purge.pm: Likewise. * lib/App/Glacier/Command/Put.pm: Likewise. * lib/App/Glacier/Command/Sync.pm: Likewise. * lib/App/Glacier/Directory.pm: Likewise. * lib/App/Glacier/Job.pm: Use Bre API. Use the init method to initialize the job. * lib/App/Glacier/Job/ArchiveRetrieval.pm (init): New method. * lib/App/Glacier/Job/InventoryRetrieval.pm: Likewise.
2018-12-14Rework the DB class system in order to facilitate backend implementation.Sergey Poznyakoff9
* lib/App/Glacier/Command.pm: Use configtest methods for database configuration. * lib/App/Glacier/Config.pm (as_hash): ignore special keys (_lint): Increase error count if unknown keyword is encountered. (lint): Optional arguments specify path to the statement from which to start linting. * lib/App/Glacier/DB.pm: Provide the configtest method. * lib/App/Glacier/DB/GDBM.pm (new): Use the optional 'create' keyword for testing whether to create the directory. Implement the configtest method. * lib/App/Glacier/Directory/GDBM.pm: Provide defaults for configtest. * lib/App/Glacier/Directory.pm (new): Expand $vault in the actual parameter values to the vault name. * lib/App/Glacier/Job.pm: Remove unused variables. * lib/App/Glacier/Roster.pm: New file. * lib/App/Glacier/Roster/GDBM.pm: New file.
2018-12-13Rewrite Glacier::DBSergey Poznyakoff4
* lib/App/Glacier/Command.pm (jobdb, directory): Change agruments to constructors. * lib/App/Glacier/DB.pm: Rewrite as a facade * lib/App/Glacier/DB/GDBM.pm: Rewrite as a backend for Glacier::DB * lib/App/Glacier/Directory.pm: Inherit from Glacier::DB
2018-12-13Implement Config as_hash methodSergey Poznyakoff1
2018-12-12Minor fixSergey Poznyakoff1
* lib/App/Glacier/Command/Periodic.pm (run): Use the touchdir method.
2018-12-12Use Text::Locus instead of App::Glacier::Config::LocusSergey Poznyakoff2
2018-12-12BugfixSergey Poznyakoff3
* lib/App/Glacier/DB.pm (decode): use extra assignment to avoid the "attempt to copy freed scalar" panic. * lib/App/Glacier/Timestamp.pm (_to_timestamp): Rewrite the HASH part. * lib/App/Glacier/DB/GDBM.pm: Minor changes.
2018-12-11Implement the 'periodic' commandSergey Poznyakoff6
* lib/App/Glacier.pm: Implement new command. * lib/App/Glacier/Command.pm: New configuration statement transfer.download.cachedir (archive_cache_filename): New method. * lib/App/Glacier/Command/Get.pm (run): Use cache file, if available. (_open_output): As a temporary solution, protect the call to $job->file_name by eval. * lib/App/Glacier/Command/Periodic.pm: New file. * lib/App/Glacier/Job.pm (fromdb): New class method. (cache_file): New method.
2018-03-08Version 2.00Sergey Poznyakoff4
* Changes: Version 2.00 * lib/App/Glacier.pm (new): Fix option parsing. * lib/App/Glacier/Core.pm (clone): New method. * lib/App/Glacier/Command.pm (clone): New method. * lib/App/Glacier/Command/ListVault.pm: Clone the Sync method from $self, instead of initializing it from scratch.
2018-03-08Minor fix (purge)Sergey Poznyakoff1
2018-03-06Minor changesSergey Poznyakoff4
* lib/App/Glacier.pm: Make sure the NAME section begins with the package name, otherwise MakeMaker is unable to retrieve abstract from it. This creates wrongly named manpage, though. * lib/App/Glacier/Command/ListVault.pm: New option --cached. Use --sort=name by default. * lib/App/Glacier/Job.pm: Display the diagnostics received from Amazon in case of 404 response.
2018-03-06Provide a core class. Change inheritance graph.Sergey Poznyakoff15
* lib/App/Glacier/Core.pm: New file. * Makefile.PL: Get abstract and version from lib/App/Glacier.pm * glacier: Change App::Glacier creation. * lib/App/Glacier.pm: Inherit from App::Glacier::Core. * lib/App/Glacier/Command.pm: Likewise. Rewrite constructor. * lib/App/Glacier/Command/CreateVault.pm: Change run() method. * lib/App/Glacier/Command/DeleteFile.pm: Likewise. * lib/App/Glacier/Command/DeleteVault.pm: Likewise. * lib/App/Glacier/Command/Get.pm: Rewrite getopt method as new(). Change the run() method. * lib/App/Glacier/Command/Jobs.pm: Likewise. * lib/App/Glacier/Command/ListVault.pm: Likewise. * lib/App/Glacier/Command/Purge.pm: Likewise. * lib/App/Glacier/Command/Put.pm: Likewise. * lib/App/Glacier/Command/Sync.pm: Likewise. * lib/App/Glacier/Config.pm (new): Initialize debug and ci. * lib/App/Glacier/Job.pm: Inherit from App::Glacier::Core. * lib/App/Glacier/Job/FileRetrieval.pm: Likewise.
2018-02-25Organizational changesSergey Poznyakoff3
* LICENSE: New file. * glacier: Move main functionality to App::Glacier. * lib/App/Glacier.pm: Move code here. * lib/App/Glacier/Config.pm: Use warnings. * lib/App/Glacier/Config/Locus.pm: Likewise.
2018-02-24Version 1.00v1.00Sergey Poznyakoff6
2017-05-27glacier jobs: verify jobs by defaultSergey Poznyakoff1
* lib/App/Glacier/Command/Jobs.pm: Verify jobs by default. Use -c, --cached option to suppress verification and display cached results. Remove the --check option.
2017-05-27Minor formatting fixSergey Poznyakoff1
2017-05-25Improve progress meter for single uploads.Sergey Poznyakoff2
* lib/App/Glacier/Progress.pm (new): New options: show_dots and show_none * lib/App/Glacier/Command/Put.pm (_upload_simple): Use show_none
2017-05-25Error checking when opening gdbmSergey Poznyakoff1
* lib/App/Glacier/DB/GDBM.pm (new): New keyword argument "retries". Set the _retries attribute. (_tied): Check return value from tie. In case of failure, retry at most _retries times, with one second interval between retries
2017-05-25Change put argumentsSergey Poznyakoff1
By default, the command expects one or more names of the local files and uploads them under their base names. The -r (--rename) option changes this behavior. With this option, exactly three arguments are expected: the vault name, the name of the local file, and the name for that file in the vault directory. * lib/App/Glacier/Command/Put.pm: Remove the -m (--multiple) option. Replace it with the -r (--rename) option of the opposite meaning. Accept one or more files to upload by default.
2017-05-24Implement upload of multiple files in a single commandSergey Poznyakoff4
* lib/App/Glacier/Command.pm (new): Fix call to the abend method. * lib/App/Glacier/Command/Purge.pm: Default to interactive mode. * lib/App/Glacier/Command/Put.pm: Upload multiple files, if -m (--multiple) option is given. * lib/App/Glacier/Progress.pm (new): Call display.
2017-05-24BugfixesSergey Poznyakoff2
* Makefile.PL (MY::postamble): Restore @INC to its original value before returning. * lib/App/Glacier/Command/Sync.pm: Support --dry-run * lib/App/Glacier/DateTime.pm (_fmt_default, _fmt_iso): Do all time calculations in UTC.
2017-05-24Implement new subcommand; fix DateTime conversionsSergey Poznyakoff10
* Makefile.PL (MY::postamble): Add lib to @INC Fix rule creation. * glacier (comtab): New subcommand jobs. * lib/App/Glacier/Command/Jobs.pm: New command. * lib/App/Glacier/DB.pm (transcode): Fix json encoding/decoding. * lib/App/Glacier/DB/GDBM.pm (delete, foreach): Cache keys to be deleted in the _deleted array during iteration and delete them afterwards. Allow for nested foreach calls. * lib/App/Glacier/DateTime.pm (TO_JSON): New method. * lib/App/Glacier/Job/InventoryRetrieval.pm (new): Add desription to the initiate_inventory_retrieval call. * lib/App/Glacier/Timestamp.pm: Major rewrite: (timestamp_unserialize): Removed. (timestamp_unserialize): Rename to timestamp_deserialize. (_to_timestamp): Rewrite to eliminate the need for dclone. Assume any key ending in "Date" to be a DateTime. (Side note: dclone incorrectly clones DateTime objects, which was what triggered the rewrite). * lib/App/Glacier/Command/Sync.pm: Update calls to timestamp_deserialize. * lib/App/Glacier/Command.pm: Likewise. * lib/App/Glacier/Command/ListVault.pm: Likewise. * lib/App/Glacier/Job.pm: Likewise.
2017-05-24Add Makefile.PLSergey Poznyakoff1
2017-05-24Check for job expirationSergey Poznyakoff6
* glacier: Document the database.*.ttl statements * lib/App/Glacier/Command.pm (parameters): New database statements: "ttl" * lib/App/Glacier/Command/Get.pm (run): Fix malformed message. * lib/App/Glacier/Job.pm (new): New keyword argument ttl. (_get_job): Re-check completed job older than _ttl using describe_job. * lib/App/Glacier/Job/ArchiveRetrieval.pm (new): Pass additional data (including the description) via keyword arguments. * lib/App/Glacier/Job/FileRetrieval.pm (new): Pass ttl and description as keyword arguments. * lib/App/Glacier/Job/InventoryRetrieval.pm (new): Pass ttl
2017-05-23Document all commandsSergey Poznyakoff8
2017-05-23Implement progress meter; make number of retries configurable.Sergey Poznyakoff4
* lib/App/Glacier/Command.pm (parameters): New parameters: transfer.retries, transfer.upload.retries, and transfer.download.retries * lib/App/Glacier/Command/Get.pm: Implement progress meter. Make number of retries configurable. * lib/App/Glacier/Command/Put.pm: Likewise. * lib/App/Glacier/Progress.pm: New file.
2017-05-23get: improve part size computationSergey Poznyakoff1
* lib/App/Glacier/Command/Get.pm: Redo the part size calculation in the similar vein as in Put.pm Retry if downloading fails
2017-05-23Improve transfer configurationSergey Poznyakoff3
* lib/App/Glacier/Command.pm (ck_size): New function. New configuration file sections: [transfer], [transfer upload], and [transfer download] configure number of jobs and maximal size for single-part transfer operation. (cf_transfer_param, dry_run): New methods. (glacier_eval): Fix context evaluation. * lib/App/Glacier/Command/Get.pm: Rewrite using new cinfiguration parameters. Remove the --part-size option. Honor the dry_run setting. * lib/App/Glacier/Command/Put.pm: : Rewrite using new cinfiguration parameters. Honor the dry_run setting.
2017-05-22Fix multipart upload & downloadSergey Poznyakoff4
* lib/App/Glacier/Command/Get.pm: Fix chunk alignment and the use of shared variables. * lib/App/Glacier/Command/ListVault.pm: Fix typo. * lib/App/Glacier/Command/Put.pm (_upload_multipart): Rewrite. * lib/App/Glacier/DB/GDBM.pm: Don't keep the DB mapped through the lifetime of the object, as this interacts badly with the threaded code (it causes coredumps when the copies of the object are destroyed in their corresponding threads, which means that the underlying gdbm_close gets called multiple times on the same GDBM structure. See comment to the _tied method, for details).
2017-05-22Further fixes in get and syncSergey Poznyakoff6
* lib/App/Glacier/Command.pm (glacier_eval): Check for return context and return appropriate type. * lib/App/Glacier/Command/Get.pm (run): Minor simplification. (run): Delete failed jobs. (download): Revamp multi-part download algorithm. * lib/App/Glacier/Command/ListVault.pm (getopt): Use Command::set_time_style_option to set the --time-style option. * lib/App/Glacier/Command/Sync.pm (sync): Restart expired jobs. (_sync): Actually store the changed DB records. * lib/App/Glacier/DateTime.pm (format_can): New format: standard * lib/App/Glacier/Job.pm (new): Set _job => undef, to avoid spurious warnings. (_get_job): Handle invalidate for cached values as well (is_finished, status): New methods. (forget): Rename to delete.
2017-05-21Implement get and purgeSergey Poznyakoff8
* glacier: Register purge and get * lib/App/Glacier/Command.pm (getyn): New method. * lib/App/Glacier/Command/DeleteFile.pm: Don't invalidate directory on completion. * lib/App/Glacier/Command/Get.pm: New file. * lib/App/Glacier/Command/Purge.pm: New file. * lib/App/Glacier/Command/ListVault.pm (get_vault_inventory): Only check for DIR_PENDING. DIR_OUTDATED is mostly irrelevant, because the inventory can be as much as 24 hours old. * lib/App/Glacier/Command/Put.pm: Fix argument checking. Don't invalidate directory on completion. * lib/App/Glacier/Job.pm: Implement debugging. * lib/App/Glacier/Job/FileRetrieval.pm: Bugfixes.
2017-05-20Implement rm and rmvaultSergey Poznyakoff7
* glacier: Register the rmvault and rm commands * lib/App/Glacier/Command/DeleteFile.pm: New file. * lib/App/Glacier/Command/DeleteVault.pm: New file. * lib/App/Glacier/Command/ListVault.pm: New option --cached * lib/App/Glacier/Command/Sync.pm: New options --delete and --force (_sync): Don't delete records without matching inventory entry, unless --delete is requested. * lib/App/Glacier/DB/GDBM.pm (drop): Delete the %dbtab entry. * lib/App/Glacier/Directory.pm (add_version): Return assigned version number. * lib/App/Glacier/Job.pm: Minor change
2017-05-19BugfixesSergey Poznyakoff4
* glacier: Pass arguments to the command constructors. This fixes functionality of options passed via %args * lib/App/Glacier/Command/ListVault.pm (show_archive) (get_vault_inventory): Pass version number in FileVersion, and the total number of versions in FileTotalVersions * lib/App/Glacier/Command/Put.pm (run): Actually trigger inventory retrieval. * lib/App/Glacier/DB/GDBM.pm (new): Save filename. (drop): New method. * lib/App/Glacier/Directory.pm (delete_version): New method.
2017-05-19Implement the put commandSergey Poznyakoff8
* glacier: Register the put command * lib/App/Glacier/Command.pm (multipart-upload-size): New configuration parameter. * lib/App/Glacier/Command/ListVault.pm: Remove useless sub * lib/App/Glacier/Command/Put.pm: New file. * lib/App/Glacier/DateTime.pm (new): New constructor. * lib/App/Glacier/Directory.pm (info): Rewrite as accessor (set_info, is_dirty, clear_dirty, invalidate): New methods. (update_sync_time): Clear the Dirty flag. (status): Return DIR_OUTDATED if Dirty is set. * lib/App/Glacier/Job.pm: New keyword argument "invalidate". (_get_job): Initiate new job if _invalidate is set. * lib/App/Glacier/Job/InventoryRetrieval.pm (new): Pass all arguments to the super-class.
2017-05-19Implement Directory::status method.Sergey Poznyakoff3
* lib/App/Glacier/Command.pm (config, cfget): New accessors. * lib/App/Glacier/Directory.pm (status): New method. * lib/App/Glacier/Command/ListVault.pm (get_vault_inventory): Use Directory::status. (getopt): More ls-compatible options.
2017-05-19Implement listing filesSergey Poznyakoff6
* lib/App/Glacier/Command.pm: Avoid calling describe_vault if db file already exists. * lib/App/Glacier/Command/ListVault.pm: Implement listing files * lib/App/Glacier/Command/Sync.pm (sync): New method * lib/App/Glacier/DB/GDBM.pm: Use static variable to keep existing mappings. This avoids locking problems if the same database is opened several times. * lib/App/Glacier/Directory.pm (update_sync_time): New method. * lib/App/Glacier/Glob.pm (glob2pat): Bugfix: don't modify arguments
2017-05-18Implement syncSergey Poznyakoff12
2017-05-17Implement ls -dSergey Poznyakoff7
2017-05-16Initial commitSergey Poznyakoff14

Return to:

Send suggestions and report system problems to the System administrator.