{"id":15654329,"url":"https://github.com/galeone/bacup","last_synced_at":"2025-04-15T11:13:02.264Z","repository":{"id":48955860,"uuid":"346474304","full_name":"galeone/bacup","owner":"galeone","description":"An easy-to-use backup tool designed for servers.","archived":false,"fork":false,"pushed_at":"2024-03-17T18:47:03.000Z","size":133,"stargazers_count":29,"open_issues_count":5,"forks_count":4,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-03-28T19:21:19.639Z","etag":null,"topics":["backup","backup-tool","rust","rust-lang"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/galeone.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2021-03-10T19:50:30.000Z","updated_at":"2024-11-23T12:05:49.000Z","dependencies_parsed_at":"2022-09-02T03:22:03.487Z","dependency_job_id":"1d7f38e2-4dc2-4b05-8e24-e89fa070ef52","html_url":"https://github.com/galeone/bacup","commit_stats":{"total_commits":94,"total_committers":2,"mean_commits":47.0,"dds":"0.021276595744680882","last_synced_commit":"9e187efa175ab7774dd5e03f99649f50754e0f85"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/galeone%2Fbacup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/galeone%2Fbacup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/galeone%2Fbacup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/galeone%2Fbacup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/galeone","download_url":"https://codeload.github.com/galeone/bacup/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248681473,"owners_count":21144699,"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","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":["backup","backup-tool","rust","rust-lang"],"created_at":"2024-10-03T12:50:46.864Z","updated_at":"2025-04-15T11:13:02.245Z","avatar_url":"https://github.com/galeone.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# bacup\n\nAn easy-to-use backup tool designed for servers - written in Rust.\n\n---\n\nThe bacup service runs as a deamon and executes the backup of the **services** on the **remotes**.\n\nThe goal of bacup is to make the configuration straightforward: a single file where defining everything in a very simple way.\n\n## Configuration\n\n3 steps configuration.\n\n1. Configure the **remotes**. A remote is a cloud provider, or a SSH host, or a git server.\n2. Configure the **services**. A service is a well-known software (e.g. PostgreSQL) with his own backup tool, or is a location on the filesystem.\n3. Map services (**what** to backup) to remotes (**where** to backup). Configure the **backup**.\n\nWhen configuring the backups, the field **when** accepts configuration strings in the format:\n\n- `\"daily $hh:$mm` e.g. `daily 15:30`\n- `weekly $day $hh:$mm` e.g. `weekly mon 12:23` or `weekly monday 12:23`. `weekly` can be omitted.\n- `monthly $day $hh:$mm` e.g. `monthly 1 00:30`\n- **cron**. If you really have to use it, use [crontab guru](https://crontab.guru/) to create the cron string.\n\n**NOTE**: The time is ALWAYS in UTC timezone.\n\n```toml\n# remotes definitions\n[aws]\n    [aws.bucket_name]\n    region = \"\"# \"eu-west-3\"\n    access_key = \"\"\n    secret_key = \"\"\n\n# Not available yet!\n#[gcloud]\n#    [gcloud.bucket1]\n#    service_account_path = \"\"\n\n[ssh]\n    [ssh.remote_host1]\n    host = \"\" # example.com\n    port = \"\" # 22\n    username = \"\" # myname\n    private_key = \"\" # ~/.ssh/id_rsa\n\n[localhost]\n    # Like copy-paste in local. The underlying infrastructure manages\n    # the remote (if any) part. Below 2 examples\n    [localhost.samba]\n    path = \"\" # local path where samba is mounted\n\n    [localhost.disk2]\n    path = \"\" # local path where the second disk of the machine is mounted\n\n[git]\n    [git.remote_repo]\n    host = \"\" #github.com\n    port = \"\" #22\n    username = \"\" #git\n    private_key = \"\" # ~/.ssh/id_rsa\n    repository = \"\" # \"galeone/bacup\"\n    branch = \"\" # master\n\n# what to backup. Service definition\n[postgres]\n    [postgres.service1]\n    username = \"\"\n    db_name = \"\"\n    host = \"\"\n    port = \"\"\n\n[folders]\n    [folders.service1]\n    pattern = \"\"\n\n[docker]\n    [docker.service]\n    container_name = \"docker_postgres_1\"\n    command = \"pg_dumpall -c -U postgres\" # dump to stdout always\n\n# mapping services to remote\n[backup]\n    # Compress the DB dump and upload it to aws\n    # everyday at 01:00 UTC\n    [backup.service1_db_compress]\n    what = \"postgres.service1\"\n    where = \"aws.bucket_name\"\n    when = \"daily 01:00\"\n    remote_path = \"/service1/database/\"\n    compress = true\n    keep_last = 7\n\n    # Dump the DB and upload it to aws (no compression)\n    # every first day of the month\n    [backup.service1_db]\n    what = \"postgres.service1\"\n    where = \"aws.bucket_name\"\n    when = \"monthly 1 00:00\"\n    remote_path = \"/service1/database/\"\n    compress = false\n\n    # Archive the files of service 1 and upload them to\n    # the ssh.remote_host1 in the remote ~/backups/service1 folder.\n    # Every friday at 5:00\n    [backup.service1_source_compress]\n    what = \"folders.service1\"\n    where = \"ssh.remote_host1\"\n    when = \"weekly friday 05:00\"\n    remote_path = \"~/backups/service1\"\n    compress = true\n\n    # Incrementally sync folders.service1 with the remote host\n    # using rsync (authenticated trough ssh)\n    # At 00:05 in August\n    [backup.service1_source]\n    what = \"folders.service1\"\n    where = \"ssh.remote_host1\"\n    when = \"5 0 * 8 *\"\n    remote_path = \"~/backups/service1_incremental/\"\n    compress = false # no compression = incremental sync\n\n    # Compress the DB dump and copy it to the localhost \"remote\"\n    # where, for example, samba is mounted\n    # everyday at 01:00 UTC\n    [backup.service1_db_on_samba]\n    what = \"postgres.service1\"\n    where = \"localhost.samba\"\n    when = \"daily 01:00\"\n    remote_path = \"/path/inside/the/samba/location\"\n    compress = false\n\n    [backup.service1_source_git]\n    what = \"folders.service1\"\n    where = \"git.github\"\n    when = \"daily 15:30\"\n    remote_path = \"/\" # the root of the repo\n    compress = false\n```\n\nWhen `compression = true`, the file/folder are compressed using Gzip and the file is archived (in the desired remote location) with the format:\n\n```\nYYYY-MM-DD-hh:mm-filename.gz # or .tar.gz if filename is an archive\n```\n\n## Installation \u0026 service setup\n\n```\ncargo install bacup\n```\n\nThen put the `config.toml` file in `$HOME/.bacup/config.toml`.\n\nThere's a ready to use `systemd` service file:\n\n```\nsudo cp misc/systemd/bacup@.service /usr/lib/systemd/system/\n```\n\nthen, the service can be enabled/started in the usual systemd way:\n\n```\nsudo systemctl start bacup@$USER.service\nsudo systemctl enable bacup@$USER.service\n```\n\n## Remote configuration\n\nConfiguring the remotes is straightforward. Every remote have a different way of getting the access code, here we try to share some useful reference.\n\n### AWS\n\n- Access Key \u0026 Secret Key: [Understanding and getting your AWS credentials: programmatic access](https://docs.aws.amazon.com/general/latest/gr/aws-sec-cred-types.html#access-keys-and-secret-access-keys)\n- Region: the region is the region of your bucket.\n- Endpoint: (optional) the endpoint to use for the client, i.e. another s3 compatible service.\n- force_path_style: (optional) Forces this client to use path-style addressing for buckets, necessary for some s3 compatible gateways.\n\n### SSH\n\nYou need a valid ssh account on your remote - only authentication via SSH key without passphrase is supported.\n\nFor incremental backup `rsync` is used - you need this tool installed locally and remotely.\n\n### Git\n\nYou need a valid account on a Git server, together with a repository. Only SSH is supported.\n\n### Localhost\n\nNot properly a remote, but you can use `bacup` to bacup from a path to another (with/without compression). If the localhost remote is mounted on a network filesystem it's better :)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgaleone%2Fbacup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgaleone%2Fbacup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgaleone%2Fbacup/lists"}