{"id":31715312,"url":"https://github.com/alphahydrae/bacliup","last_synced_at":"2025-10-09T01:55:42.448Z","repository":{"id":310059002,"uuid":"519619113","full_name":"AlphaHydrae/bacliup","owner":"AlphaHydrae","description":"A backup solution based on Bash, cron and rclone, for when the command line is good enough, Docker included 🎉","archived":false,"fork":false,"pushed_at":"2025-08-15T12:25:34.000Z","size":134,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-15T14:21:11.652Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AlphaHydrae.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-07-30T20:56:48.000Z","updated_at":"2025-08-15T12:25:37.000Z","dependencies_parsed_at":"2025-08-15T14:21:23.902Z","dependency_job_id":"40218490-7e9d-4107-aff2-fab2e6911ab8","html_url":"https://github.com/AlphaHydrae/bacliup","commit_stats":null,"previous_names":["alphahydrae/bacliup"],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/AlphaHydrae/bacliup","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlphaHydrae%2Fbacliup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlphaHydrae%2Fbacliup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlphaHydrae%2Fbacliup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlphaHydrae%2Fbacliup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AlphaHydrae","download_url":"https://codeload.github.com/AlphaHydrae/bacliup/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlphaHydrae%2Fbacliup/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279000696,"owners_count":26082894,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-08T02:00:06.501Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-10-09T01:55:39.798Z","updated_at":"2025-10-09T01:55:42.443Z","avatar_url":"https://github.com/AlphaHydrae.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Bacliup\n\n\u003e **A backup solution based on Bash, cron \u0026 rclone, _for when the command line\n\u003e is good enough_, Docker included :tada:**\n\n[![build](https://github.com/AlphaHydrae/bacliup/actions/workflows/build.yml/badge.svg)](https://github.com/AlphaHydrae/bacliup/actions/workflows/build.yml)\n[![MIT License](https://img.shields.io/static/v1?label=license\u0026message=MIT\u0026color=informational)](https://opensource.org/licenses/MIT)\n\n* Back up anything you can access from a [Bash][bash] script, using [tar][tar],\n  [gzip][gzip] and [GnuPG][gnupg] to create, compress and encrypt archives.\n* Easy periodic backups with [Cron][cron].\n* Local/remote backup storage with [rclone][rclone] to [any supported\n  provider][rclone-providers].\n* Success/failure notifications with [Slack][slack] (using [curl][curl] and\n  [jq][jq] for the integration).\n\n\u003c!-- START doctoc generated TOC please keep comment here to allow auto update --\u003e\n\u003c!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --\u003e\n\n- [Usage](#usage)\n- [How it works](#how-it-works)\n- [Configuration](#configuration)\n  - [Backup configuration files](#backup-configuration-files)\n  - [Command line options \u0026 environment variables](#command-line-options--environment-variables)\n  - [Import GPG encryption key](#import-gpg-encryption-key)\n  - [Slack notifications](#slack-notifications)\n  - [Docker configuration](#docker-configuration)\n  - [Additional configuration](#additional-configuration)\n- [Exit codes](#exit-codes)\n\n\u003c!-- END doctoc generated TOC please keep comment here to allow auto update --\u003e\n\n## Usage\n\n```bash\n# With the necessary environment variables and configuration files\nbacliup\n\n# By hand\nbacliup --name my-backup \\\n        --to dest: \\\n        --script /usr/local/bin/backup \\\n        --gpg-recipient \"John Doe \u003cjohn.doe@example.com\u003e\"\n```\n\nBacliup will store a file named `my-backup.20010203T040506Z.tar.gpg` to the\nspecified Rclone destination (where `20010203T040506Z` is the valid ISO-8601\ndate and time at which that backup was created).\n\n\u003e [!TIP]\n\u003e Bacliup assumes that you have already configured Rclone. In these examples, a\n\u003e `dest` Rclone remote must be configured.\n\nYou can also configure cron to run your backups on a schedule:\n\n```bash\nbacliup init\n```\n\n\u003e [!TIP]\n\u003e This requires you to create some Bacliup-specific [backup configuration\n\u003e files](#backup-configuration-files).\n\n## How it works\n\nWhen running, bacliup goes through this process:\n\n* A temporary directory is created to store backup files in. This directory will\n  be deleted when Bacliup exits.\n* An arbitrary backup script provided by you is executed.\n\n  It's up to you to copy whatever you want (files, database dumps, etc) in the\n  current working directory (also available as the `$BACKUP_DIR` environment\n  variable).\n* The temporary directory is archived with [tar][tar].\n* The archive is compressed with [gzip][gzip].\n* The compressed archive is encrypted with [GnuPG][gnupg].\n* The encrypted backup is copied/uploaded to the [rclone][rclone] destination\n  you have configured.\n\n\u003e [!IMPORTANT]\n\u003e You will need enough storage space for whatever uncompressed backups you put\n\u003e in the temporary directory. The archival, compression, encryption and upload\n\u003e happens in memory in a single Unix pipeline without storing any additional\n\u003e data on disk.\n\n## Configuration\n\nYou can configure Bacliup in two ways:\n\n- Entirely from environment variables and command line arguments.\n- From backup configuration files (only some configuration options are supported\n  for now).\n\n### Backup configuration files\n\nWhen you run Bacliup with a backup \"type\" like so:\n\n```bash\nbacliup hourly\n```\n\nBacliup will look for an `hourly` configuration file (in the\n`/etc/bacliup/backups` directory by default). This file is expected to have the\nfollowing format:\n\n```\nto dest:hourly/my-backup/\ncron 0 * * * *\n```\n\nThe available backup configuration file keys are:\n\n| Key                 | Default value | Description                                                                                                |\n| :------------------ | :------------ | :--------------------------------------------------------------------------------------------------------- |\n| `to`                | `dest:`       | Rclone destination to store the backup to (in the format `remote:path` where `remote` is an Rclone remote) |\n| `cron`              | -             | Optional cron schedule to set up for this backup type when configuring cron with `bacliup init`            |\n| `rclone-opts`       | -             | Additional options to pass to the `rclone` command                                                         |\n| `slack-webhook-url` | -             | Slack webhook URL specific to this backup type                                                             |\n\n### Command line options \u0026 environment variables\n\nThese are the main configuration options for Bacliup:\n\n| Environment variable          | Command line                | Default value           | Description                                                                                                 |\n| :---------------------------- | :-------------------------- | :---------------------- | :---------------------------------------------------------------------------------------------------------- |\n| `$BACLIUP_BACKUP_TYPE`        | _(optional) first argument_ | `default`               | Type of backup (determines which backup configuration file is read if you are using them)                   |\n| `$BACLIUP_BACKUP_NAME`        | `-n`, `--name`              | `backup`                | Name of the backup (becomes part of the backup file name)                                                   |\n| `$BACLIUP_BACKUP_CONFIGS_DIR` | -                           | `/etc/bacliup/backups`  | Directory containing the backup configurations                                                              |\n| `$BACLIUP_BACKUP_SCRIPT`      | `-s`, `--script`            | `/usr/local/bin/backup` | Arbitrary script that will perform the actual backup                                                        |\n| `$BACLIUP_BACKUP_TO`          | `-t`, `--to`                | `dest:`                 | Rclone destination to store the backup to (in the format `remote:path`, where `remote` is an Rclone remote) |\n| `$BACLIUP_BACKUP_TO_PREFIX`   | `--to-prefix`               | -                       | Prefix prepended to `$BACLIUP_BACKUP_TO` or `-t`/`--to` to form the complete Rclone destination             |\n| `$BACLIUP_BACKUP_TO_SUFFIX`   | `--to-suffix`               | -                       | Suffix appended to `$BACLIUP_BACKUP_TO` or `-t`/`--to` to form the complete Rclone destination              |\n| `$BACLIUP_GPG_RECIPIENT`      | `-r`, `--gpg-recipient`     | -                       | Comma-separated GPG recipients for backup encryption                                                        |\n\n### Import GPG encryption key\n\nBacliup can import a GPG encryption key for you:\n\n```bash\nbacliup import-gpg\n```\n\nThis requires setting either the `$BACLIUP_GPG_IMPORT_KEY` or the\n`$BACLIUP_GPG_IMPORT_KEY_FILE` environment variable, as well as the\n`$BACLIUP_GPG_IMPORT_KEY_ID` environment variable to the ID of the key to\nimport. It will be configured for ultimate trust.\n\n| Environment variable           | Default value | Description                                                      |\n| :----------------------------- | :------------ | :--------------------------------------------------------------- |\n| `$BACLIUP_GPG_IMPORT_KEY`      | -             | GPG public key to import for backup encryption                   |\n| `$BACLIUP_GPG_IMPORT_KEY_FILE` | -             | File containing a GPG public key to import for backup encryption |\n| `$BACLIUP_GPG_IMPORT_KEY_ID`   | -             | ID of the GPG public key for backup encryption                   |\n\n### Slack notifications\n\nYou can configure backup success notifications in Slack with the following\noptions:\n\n| Environment variable         | Default value  | Description                                                                                      |\n| :--------------------------- | :------------- | :----------------------------------------------------------------------------------------------- |\n| `$BACLIUP_SLACK_WEBHOOK_URL` | -              | Slack webhook URL to send backup success notifications                                           |\n| `$BACLIUP_TEMPLATES_DIR`     | `../templates` | Directory containing the JSON templates for Slack notifications (relative to the Bacliup script) |\n\n### Docker configuration\n\nThe following environment variables are specific to Bacliup usage with the\nprovided Dockerfile:\n\n| Environment variable              | Default value | Description                                                                                                |\n| :-------------------------------- | :------------ | :--------------------------------------------------------------------------------------------------------- |\n| `$BACLIUP_MINUTELY_TO`            | -             | Rclone destination of the every-minute backups (set to enable)                                             |\n| `$BACLIUP_MINUTELY_CRON`          | `* * * * *`   | Cron schedule for the every-minute backups                                                                 |\n| `$BACLIUP_HOURLY_TO`              | -             | Rclone destination of the hourly backups (set to enable)                                                   |\n| `$BACLIUP_HOURLY_MINUTE`          | `0`           | Minute of the hour at which the hourly backups will run                                                    |\n| `$BACLIUP_HOURLY_CRON`            | `0 * * * *`   | Cron schedule for the hourly backups (built from `$BACLIUP_HOURLY_MINUTE` by default)                      |\n| `$BACLIUP_DAILY_TO`               | -             | Rclone destination of the daily backups (set to enable)                                                    |\n| `$BACLIUP_DAILY_MINUTE`           | `15`          | Minute of the hour at which the daily backups will run                                                     |\n| `$BACLIUP_DAILY_HOUR`             | `0`           | Hour of the day at which the daily backups will run                                                        |\n| `$BACLIUP_DAILY_CRON`             | `15 0 * * *`  | Cron schedule for the daily backups (built from `$BACLIUP_DAILY_MINUTE/HOUR` by default)                   |\n| `$BACLIUP_WEEKLY_TO`              | -             | Rclone destination of the weekly backups (set to enable)                                                   |\n| `$BACLIUP_WEEKLY_MINUTE`          | `30`          | Minute of the hour at which the weekly backups will run                                                    |\n| `$BACLIUP_WEEKLY_HOUR`            | `0`           | Hour of the day at which the weekly backups will run                                                       |\n| `$BACLIUP_WEEKLY_DAY_OF_THE_WEEK` | `0`           | Day of the week on which the weekly backups will run                                                       |\n| `$BACLIUP_WEEKLY_CRON`            | `15 0 * * *`  | Cron schedule for the weekly backups (built from `$BACLIUP_WEEKLY_MINUTE/HOUR/DAY_OF_THE_WEEK` by default) |\n| `$BACLIUP_MONTHLY_TO`             | -             | Rclone destination of the monthly backups (set to enable)                                                  |\n| `$BACLIUP_MONTHLY_MINUTE`         | `45`          | Minute of the hour at which the monthly backups will run                                                   |\n| `$BACLIUP_MONTHLY_HOUR`           | `0`           | Hour of the day at which the monthly backups will run                                                      |\n| `$BACLIUP_MONTHLY_DAY`            | `0`           | Day of the month on which the monthly backups will run                                                     |\n| `$BACLIUP_MONTHLY_CRON`           | `15 0 * * *`  | Cron schedule for the monthly backups (built from `$BACLIUP_MONTHLY_MINUTE/HOUR/DAY` by default)           |\n| `$BACLIUP_UID`                    | -             | If set, the UID of the `bacliup` user in the container will be changed on startup                          |\n| `$BACLIUP_GID`                    | -             | If set, the GID of the `bacliup` user in the container will be changed on startup                          |\n\n### Additional configuration\n\nThese other configuration options are also provided:\n\n| Environment variable          | Command line    | Default value            | Description                                                                 |\n| :---------------------------- | :-------------- | :----------------------- | :-------------------------------------------------------------------------- |\n| `$BACLIUP_CURL_BIN`           | -               | `curl`                   | Path to the `curl` command                                                  |\n| `$BACLIUP_GPG_BIN`            | -               | `gpg`                    | Path to the `gpg` command                                                   |\n| `$BACLIUP_RCLONE_BIN`         | -               | `rclone`                 | Path to the `rclone` command                                                |\n| `$BACLIUP_TAR_BIN`            | -               | `tar`                    | Path to the `tar` command                                                   |\n| `$BACLIUP_CRON_SCRIPT`        | -               | `/usr/local/bin/bacliup` | Path to Bacliup when configuring cron                                       |\n| `$BACLIUP_RCLONE_CONFIG_FILE` | -               | -                        | Custom path to an Rclone configuration file (if not using the default path) |\n| `$BACLIUP_RCLONE_OPTIONS`     | `--rclone-opts` | -                        | Additional options to pass to the `rclone` command                          |\n\n## Exit codes\n\nBacliup will exit with the following codes when known errors occur:\n\n| Code | Description                                                                                                    |\n| :--- | :------------------------------------------------------------------------------------------------------------- |\n| 1    | An unexpected error occurred.                                                                                  |\n| 2    | A required argument is missing.                                                                                |\n| 3    | A provided argument is invalid.                                                                                |\n| 4    | Unsupported extra arguments were provided.                                                                     |\n| 100  | The backup script specified with `$BACLIUP_BACKUP_SCRIPT` does not exist.                                      |\n| 101  | The backup script specified with `$BACLIUP_BACKUP_SCRIPT` is not a file.                                       |\n| 102  | The backup script specified with `$BACLIUP_BACKUP_SCRIPT` is not executable.                                   |\n| 103  | The Rclone configuration file specified with `$BACLIUP_RCLONE_CONFIG_FILE` does not exist.                     |\n| 104  | The Rclone configuration file specified with `$BACLIUP_RCLONE_CONFIG_FILE` is not a file.                      |\n| 105  | The Rclone configuration file specified with `$BACLIUP_RCLONE_CONFIG_FILE` is not readable.                    |\n| 140  | One of the GPG recipients specified with `$BACLIUP_GPG_RECIPIENT` cannot be found.                             |\n| 141  | The GPG key provided with `$BACLIUP_GPG_IMPORT_KEY` could not be imported.                                     |\n| 142  | The GPG key provided with `$BACLIUP_GPG_IMPORT_KEY` could not be trusted.                                      |\n| 160  | The configured backup destination is not a valid rclone path (e.g. `dest:path`).                               |\n| 161  | The remote storage specified in the configured backup destination cannot be found in the rclone configuration. |\n| 200  | The backup script failed                                                                                       |\n| 201  | The backup archival, encryption \u0026 upload pipeline failed                                                       |\n\n\n\n[bash]: https://www.gnu.org/software/bash/\n[cron]: https://en.wikipedia.org/wiki/Cron\n[curl]: https://curl.se\n[gnupg]: https://gnupg.org\n[gzip]: https://www.gnu.org/software/gzip/\n[jq]: https://stedolan.github.io/jq/\n[rclone]: https://rclone.org\n[rclone-providers]: https://rclone.org/#providers\n[slack]: https://slack.com\n[tar]: https://www.gnu.org/software/tar/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falphahydrae%2Fbacliup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falphahydrae%2Fbacliup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falphahydrae%2Fbacliup/lists"}