glesha Documentation
Glesha is a cross-platform archive and upload utility.
Table of Contents
Introduction
glesha is a cross-platform archive and upload CLI utility
written in golang. glesha's primary purpose is to provide a
simple and reliable method for backing up valuable data such as photos, videos and project files.
glesha simplifies backups by first packaging a directory into a
.tar.gz archive. It then uses multipart uploading to reliably
transfer even very large files to your configured
storage backend. The initial release supports Amazon S3 and allows users to select from any available
storage
class, including S3 Glacier Deep Archive, to minimize long-term costs.
glesha operates directly with your own cloud provider accounts
and is not a hosted service. This means you
maintain full ownership and control of your data.
TL;DR -
glesha archives the given file or directory into a .tar.gz file,
stores encrypted metadata in SQLite and uploads to AWS S3(or other cloud storage providers soon
).
Installation
Glesha is distributed as a single standalone binary without external dependencies. It supports most architectures across Windows, macOS, and Linux. Windows support is experimental.
-
1. Linux / MacOS
Use the one-liner script to automatically download and install -
curl -sL https://sh.txds.me/glesha | bashNote - If you have trust issues (which you must), verify the script before running, or just grab relevant binary from releases and add the binary to PATH
-
2. Windows (experimental)
Grab
glesha.exefrom releases and add the binary to PATH
Configuration
Configuration file is a JSON file used for storing storage provider credentials and preferences. You could have different config.json files for different usecases.
Some parts of the configuration file can be overriden from CLI arguments.
When you first run the program, a default config will be created for you at
~/.config/glesha/config.json, and you are supposed to modify
this configuration
to add credentials.
Here's a sample configuration -
Commands
These are common glesha subcommands used in various situations -
-
1. glesha helpPrints help documentation about a specific subcommand
Examples$ glesha help <subcommand> $ glesha help add $ glesha help run $ glesha help config -
2. glesha addQueues a glesha task that -
-
Archives the given directory into the specified archive format
-
Uploads the generated archive to the specified storage provider
The task does not start automatically. See glesha run for details.
Usage
$ glesha add [OPTIONS] PATHOPTIONS
-
--provider, -p [PROVIDER]Specifies which cloud storage providers to use for uploading. This argument, if provided, takes preference over provider specified in the CONFIG.
CONFIG must have relevant credentials to facilitate an upload for the specified providers.
Supported values for PROVIDER: aws
-
--archive-format, -a [ARCHIVE_FORMAT]Specifies which archive format to use for archiving.
This argument, if provided, takes precedence over archive_format specified in the CONFIG.
Supported values for ARCHIVE_FORMAT:
targz -
--output, -o [OUTPUT_PATH]Path to directory where archive should be generated
Default is:
~/.glesha-cache -
--config, -c [CONFIG_PATH]Path to config.json file
Default is:
~/.config/glesha/config.jsonUse "glesha help config" for more information on configuring glesha.
-
--log-level, -LSpecify log output level
Default: debug
Accepted values (in order of decreasing amount of output) -
debug, info, warn, error, silent -
PATHDirectory path that should be archived
-
-
3. glesha runRuns an existing glesha task with given ID. Following steps are involved in a "run" -
- Archive the given directory into the specified archive format
- Upload the generated archive to the specified storage provider
$ glesha run <task_id> $ glesha run 1 $ glesha run --log-level=debug run 12 $ glesha help --log-level=silent run 13 -
glesha ls- Lists all available glesha tasks -
glesha rm- Deletes a glesha task, and relevant cache files -
glesha cleanup- Cleans up cache, unwanted files created by glesha. -
glesha version- prints current version
Other commands
Examples
-
Create a targz archive and upload to s3-glacier, assuming
aws_config.jsoncontains the required credentials.glesha add -c ~/.config/glesha/aws_config.json ./dir_to_upload -
Create a zip archive and upload to google_drive, assuming
gd_config.jsoncontains the required credentials.glesha add -c ~/.config/glesha/gd_config.json ./dir_to_upload
...More examples will be added later