{"id":21047001,"url":"https://github.com/nachoparker/btrfs-sync","last_synced_at":"2025-05-15T19:31:32.709Z","repository":{"id":30378367,"uuid":"124544467","full_name":"nachoparker/btrfs-sync","owner":"nachoparker","description":"Smart and easy sync of BTRFS snapshots, locally or through SSH","archived":false,"fork":false,"pushed_at":"2022-01-31T07:01:28.000Z","size":147,"stargazers_count":89,"open_issues_count":11,"forks_count":21,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-03T13:38:30.502Z","etag":null,"topics":["btrfs","synchronization"],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nachoparker.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}},"created_at":"2018-03-09T13:31:44.000Z","updated_at":"2025-03-29T01:12:22.000Z","dependencies_parsed_at":"2022-08-07T15:15:19.823Z","dependency_job_id":null,"html_url":"https://github.com/nachoparker/btrfs-sync","commit_stats":null,"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nachoparker%2Fbtrfs-sync","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nachoparker%2Fbtrfs-sync/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nachoparker%2Fbtrfs-sync/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nachoparker%2Fbtrfs-sync/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nachoparker","download_url":"https://codeload.github.com/nachoparker/btrfs-sync/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254407349,"owners_count":22066221,"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":["btrfs","synchronization"],"created_at":"2024-11-19T14:34:51.699Z","updated_at":"2025-05-15T19:31:32.411Z","avatar_url":"https://github.com/nachoparker.png","language":"Shell","readme":"# btrfs-sync\n\nSmart and easy sync of BTRFS snapshots, locally or through SSH. \n\n![Example](resources/btrfs-sync.gif)\n\nCan be used in conjunction with [btrfs-snp](https://ownyourbits.com/2017/12/27/schedule-btrfs-snapshots-with-btrfs-snp/)\n\n```\n# btrfs-sync --verbose --delete /home/user/.snapshots user@server:/media/USBdrive/home-snapshots\n* Skip existing '/home/user/.snapshots/monthly_2018-01-09_200102'\n* Skip existing '/home/user/.snapshots/monthly_2018-02-08_200102'\n* Skip existing '/home/user/.snapshots/weekly_2018-02-09_140102'\n* Skip existing '/home/user/.snapshots/weekly_2018-02-16_150102'\n* Skip existing '/home/user/.snapshots/weekly_2018-02-23_150102'\n* Skip existing '/home/user/.snapshots/weekly_2018-03-02_180102'\n* Skip existing '/home/user/.snapshots/daily_2018-03-03_000101'\n* Skip existing '/home/user/.snapshots/daily_2018-03-04_080101'\n* Skip existing '/home/user/.snapshots/daily_2018-03-05_100102'\n* Skip existing '/home/user/.snapshots/daily_2018-03-06_100102'\n* Skip existing '/home/user/.snapshots/daily_2018-03-07_110102'\n* Synchronizing '/home/user/.snapshots/hourly_2018-03-08_090101' using seed '.snapshots/hourly_2018-03-07_090101'...\ntime elapsed [0:00:24] | rate [11.1MiB/s] | total size [ 132MiB]\n* Synchronizing '/home/user/.snapshots/hourly_2018-03-08_100101' using seed '.snapshots/hourly_2018-03-09_090101'...\ntime elapsed [0:01:05] | rate [11.1MiB/s] | total size [ 275MiB]\n* Deleting non existent snapshots...\nDelete subvolume (no-commit): '/media/USBdrive/home-snapshots/hourly_2018-03-08_090101'\nDelete subvolume (no-commit): '/media/USBdrive/home-snapshots/hourly_2018-03-08_100101'\n```\n\n## Features\n\n- Simple syntax\n- Progress indication\n- Support for _xz_ or _pbzip2_ compression in order to save bandwidth.\n- Retention policy\n- Automatic incremental synchronization\n- Cron friendly\n\n## Usage\n\nThe syntax is similar to that of _scp_\n\n```\nUsage:\n  btrfs-sync [options] \u003csrc\u003e [\u003csrc\u003e...] [[user@]host:]\u003cdir\u003e\n\n  -k|--keep NUM     keep only last \u003cNUM\u003e sync'ed snapshots\n  -d|--delete       delete snapshots in \u003cdst\u003e that don't exist in \u003csrc\u003e\n  -z|--xz           use xz     compression. Saves bandwidth, but uses one CPU\n  -Z|--pbzip2       use pbzip2 compression. Saves bandwidth, but uses all CPUs\n  -q|--quiet        don't display progress\n  -v|--verbose      display more information\n  -h|--help         show usage\n\n\u003csrc\u003e can either be a single snapshot, or a folder containing snapshots\n\u003cuser\u003e requires privileged permissions at \u003chost\u003e for the 'btrfs' command\n```\n\n## Examples \n\n### Manual\n\nSynchronize snapshots of _home_ to a USB drive\n\n```\n# btrfs-sync /home/user/.snapshots /media/USBdrive/home-snapshots\n```\n\nSynchronize snapshots of _home_ to a USB drive in another machine\n\n```\n# btrfs-sync /home/user/.snapshots user@server:/media/USBdrive/home-snapshots\n```\n\nSynchronize one snapshot of _home_ to a USB drive in another machine\n\n```\n# btrfs-sync /home/user/.snapshots/monthly_2018-02-08_200102 user@server:/media/USBdrive/home-snapshots\n```\n\nSynchronize only monthly snapshots of _home_ to a USB drive in another machine\n\n```\n# btrfs-sync /home/user/.snapshots/monthly_* user@server:/media/USBdrive/home-snapshots\n```\n\n### Cron \n\nDaily synchronization over the internet, keep only last 50\n\n```\ncat \u003e /etc/cron.daily/btrfs-sync \u003c\u003cEOF\n#!/bin/bash\n/usr/local/sbin/btrfs-sync --quiet --keep 50 --xz /home user@host:/path/to/snaps\nEOF\nchmod +x /etc/cron.daily/btrfs-sync\n```\n\nDaily synchronization in LAN, mirror snapshot directory\n\n```\ncat \u003e /etc/cron.daily/btrfs-sync \u003c\u003cEOF\n#!/bin/bash\n/usr/local/sbin/btrfs-sync --quiet --delete /home user@host:/path/to/snaps\nEOF\nchmod +x /etc/cron.daily/btrfs-sync\n```\n\nMore at [ownyourbits.com](https://ownyourbits.com/2018/03/09/easy-sync-of-btrfs-snapshots-with-btrfs-sync/)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnachoparker%2Fbtrfs-sync","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnachoparker%2Fbtrfs-sync","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnachoparker%2Fbtrfs-sync/lists"}