{"id":22813326,"url":"https://github.com/southclaws/restic-robot","last_synced_at":"2025-04-22T16:53:41.047Z","repository":{"id":38361749,"uuid":"155005125","full_name":"Southclaws/restic-robot","owner":"Southclaws","description":"Backups done right... by robots! Restic backup but the robot friendly version.","archived":false,"fork":false,"pushed_at":"2024-04-29T12:02:21.000Z","size":57,"stargazers_count":79,"open_issues_count":3,"forks_count":15,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-29T16:51:13.411Z","etag":null,"topics":["backup-utility","prometheus-metrics","restic","restic-backups","restic-docker"],"latest_commit_sha":null,"homepage":null,"language":"Go","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/Southclaws.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":"2018-10-27T20:13:37.000Z","updated_at":"2025-03-15T23:32:36.000Z","dependencies_parsed_at":"2024-01-14T02:36:12.695Z","dependency_job_id":"bdd70d1d-5360-41cb-8558-19c95d41a2cc","html_url":"https://github.com/Southclaws/restic-robot","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Southclaws%2Frestic-robot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Southclaws%2Frestic-robot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Southclaws%2Frestic-robot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Southclaws%2Frestic-robot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Southclaws","download_url":"https://codeload.github.com/Southclaws/restic-robot/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250283269,"owners_count":21405128,"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-utility","prometheus-metrics","restic","restic-backups","restic-docker"],"created_at":"2024-12-12T12:26:36.347Z","updated_at":"2025-04-22T16:53:41.025Z","avatar_url":"https://github.com/Southclaws.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Restic Robot\n\nBackups done right... by robots!\n\nThis is a small and simple wrapper application for [Restic](https://github.com/restic/restic/) that provides:\n\n- Automatically creates repository if it doesn't already exist\n- Scheduled backups - no need for system-wide cron\n- Prometheus metrics- know when your backups don't run!\n- JSON logs - for the robots!\n- Pre/post shell script hooks for custom behaviour! (Thanks @opthomas-prime!)\n\n## Usage\n\nJust `go build` and run it, or, if you're into Docker, `ghcr.io/southclaws/restic-robot`.\n\nEnvironment variables:\n\n- `SCHEDULE`: cron schedule\n- `RESTIC_REPOSITORY`: repository name\n- `RESTIC_PASSWORD`: repository password\n- `RESTIC_ARGS`: additional args for backup command\n- `RUN_ON_BOOT`: run a backup on startup\n- `PROMETHEUS_ENDPOINT`: metrics endpoint\n- `PROMETHEUS_ADDRESS`: metrics host:port\n- `PRE_COMMAND`: A shell command to run before a backup starts\n- `POST_COMMAND`: A shell command to run if the backup completes successfully\n- `ERROR_COMMAND`: A shell command to run if the backup errors. For example, to send a notification to a Slack channel on backup failure, you could set it to a curl command that posts to your Slack webhook.\n- `TRIGGER_ENDPOINT`: manual trigger endpoint\n\nPrometheus metrics:\n\n- `backups_all_total`: The total number of backups attempted, including failures.\n- `backups_successful_total`: The total number of backups that succeeded.\n- `backups_failed_total`: The total number of backups that failed.\n- `backup_duration_milliseconds`: The duration of backups in milliseconds.\n- `backup_files_new`: Amount of new files.\n- `backup_files_changed`: Amount of files with changes.\n- `backup_files_unmodified`: Amount of files unmodified since last backup.\n- `backup_files_processed`: Total number of files scanned by the backup for changes.\n- `backup_added_bytes`: Total number of bytes added to the repository.\n- `backup_processed_bytes`: Total number of bytes scanned by the backup for changes\n\nIt's that simple!\n\n### Manual backups\n\nSometimes backups are required out-of-band - e.g. before some manual changes to a system\nare made. Instead of running `restic` manually, or to edit the cron schedule for a single\nrun, you can trigger a manual backup by sending an HTTP POST request to the configured\n`TRIGGER_ENDPOINT` (defaulting to `http://localhost:8080/trigger`). It reuses the listen\naddress configured with `PROMETHEUS_ADDRESS`. If the endpoint is set to an empty string,\nmanual backups are disabled.\n\n## Docker Compose\n\nStick this in with your other compose services for instant backups!\n\n```yml\nservices:\n  #\n  # your stuff etc...\n  #\n\n  backup:\n    image: southclaws/restic-robot\n    restart: always\n    environment:\n      # every day at 2am\n      SCHEDULE: 0 0 2 * * *\n      RESTIC_REPOSITORY: my_service_repository\n      RESTIC_PASSWORD: ${MY_SERVICE_RESTIC_PASSWORD}\n      # restic-robot runs `restic backup ${RESTIC_ARGS}`\n      # so this is where you specify the directory and any other args.\n      RESTIC_ARGS: /data\n      B2_ACCOUNT_ID: ${B2_ACCOUNT_ID}\n      B2_ACCOUNT_KEY: ${B2_ACCOUNT_KEY}\n    volumes:\n      # Bind whatever directories to the backup container.\n      # You can safely bind the same directory to multiple containers.\n      - \"/container_data/blog/wordpress:/data/wordpress\"\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsouthclaws%2Frestic-robot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsouthclaws%2Frestic-robot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsouthclaws%2Frestic-robot/lists"}