{"id":15364160,"url":"https://github.com/kellnerd/backup","last_synced_at":"2025-07-10T20:35:40.192Z","repository":{"id":233466774,"uuid":"620878641","full_name":"kellnerd/backup","owner":"kellnerd","description":"Create file-based backups that provide full snapshots with hard links","archived":false,"fork":false,"pushed_at":"2023-03-29T15:27:21.000Z","size":6,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-07T08:02:15.076Z","etag":null,"topics":["backup","bash-script","hard-links","rsync","snapshot"],"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/kellnerd.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,"zenodo":null}},"created_at":"2023-03-29T14:47:25.000Z","updated_at":"2024-06-20T19:53:35.000Z","dependencies_parsed_at":null,"dependency_job_id":"ae2584aa-c65d-4243-88b1-ad8e2afbb6d9","html_url":"https://github.com/kellnerd/backup","commit_stats":null,"previous_names":["kellnerd/backup"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/kellnerd/backup","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kellnerd%2Fbackup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kellnerd%2Fbackup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kellnerd%2Fbackup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kellnerd%2Fbackup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kellnerd","download_url":"https://codeload.github.com/kellnerd/backup/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kellnerd%2Fbackup/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261394978,"owners_count":23152317,"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","bash-script","hard-links","rsync","snapshot"],"created_at":"2024-10-01T13:10:23.774Z","updated_at":"2025-07-10T20:35:40.141Z","avatar_url":"https://github.com/kellnerd.png","language":"Shell","readme":"# backup\n\nCollection of bash scripts that can be used to create unencrypted backups which are easy to browse and restore without dedicated backup software\n\n## Features\n\n- **File-based**: Backups consist of plain file copies which can be restored by any software\n- **Full Snapshots**: Each run creates a complete directory tree which includes all current files\n- **Incremental**: Unchanged files will not be copied again\n- **[Hard Links](https://en.wikipedia.org/wiki/Hard_link)**: No duplicates of unchanged files, snapshots share the same files on disk\n\n## Usage\n\nCreate a snapshot of your full home directory (`~`) in the `backup` folder of the current directory (using [`rsync`](https://en.wikipedia.org/wiki/Rsync) under the hood):\n\n```sh\n./backup-rsync-inc-snapshot-hardlink.sh ~ ./backup\n```\n\nAlternatively you can include only the `~/Documents` and the `~/Pictures` folder:\n\n```sh\n./backup-rsync-inc-snapshot-hardlink.sh ~ ./backup Documents Pictures\n```\n\n## Directory Structure\n\nUsing the last command above might result in the following backup structure (example):\n\n```\nbackup/\n├── 2022-12-31/\n│   ├── Documents/\n│   │   └── example.txt\n│   ├── Pictures/\n│   │   └── christmas-2022.jpg\n│   └── backup.log\n├── 2023-01-07/\n│   ├── Documents/\n│   │   └── example.txt\n│   ├── Pictures/\n│   │   ├── christmas-2022.jpg\n│   │   └── new-year-2023.jpg\n│   └── backup.log\n└── latest/\n    ├── Documents/\n    │   └── example.txt\n    └── Pictures/\n        ├── christmas-2022.jpg\n        └── new-year-2023.jpg\n```\n\nEach snapshot folder is named after the date of the backup and contains an additional log file which documents the changes since the previous snapshot.\n\nThe contents of the `latest` folder are identical to the latest snapshot (here: `2023-01-07`), which means that they are all hard-linked to the same set of files.\n\nSince the `christmas-2022.jpg` picture probably has not changed since 2022, the latest snapshots of it will still point to the same file.\n\nAssuming that `example.txt` has been changed between the two snapshots, `2022-12-31` will still be linked to the old version, while the newer snapshots will link to the updated version.\n\n**Attention**: Never edit files inside one of the snapshots (unless you clearly know what you are doing)!\nTouching a file in one of the snapshots also affects all other snapshots which are hard-linked to the same file, which is usually not what you want.\n\n## Other Scripts\n\nIf you want to backup multiple shares from an **SMB server** you can have a look at [`backup-smb-shares.sh`](backup-smb-shares.sh):\n\n- Pre-configured (example) paths and SMB user (please modify these to match your setup)\n- Asks for the SMB user's password\n- Mounts all required SMB shares before performing the backup\n- Unmounts all previously mounted SMB shares after the backup has finished\n\nAdditionally, there is also an [**older version**](backup-cp-inc-snapshot-hardlink.sh) of the script which uses `cp` instead of `rsync`.\nThe main difference is that it will not delete files from the latest snapshot which have been deleted in the source.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkellnerd%2Fbackup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkellnerd%2Fbackup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkellnerd%2Fbackup/lists"}