https://github.com/nwtgck/ibk
💾 Incremental Backup CLI using well-matured technology: tar
https://github.com/nwtgck/ibk
backup cli command-line incremental-backups
Last synced: 5 months ago
JSON representation
💾 Incremental Backup CLI using well-matured technology: tar
- Host: GitHub
- URL: https://github.com/nwtgck/ibk
- Owner: nwtgck
- License: mit
- Created: 2019-03-01T06:13:59.000Z (over 7 years ago)
- Default Branch: develop
- Last Pushed: 2021-04-29T19:29:23.000Z (about 5 years ago)
- Last Synced: 2025-07-24T15:12:32.469Z (12 months ago)
- Topics: backup, cli, command-line, incremental-backups
- Language: Go
- Homepage:
- Size: 32.2 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# ibk
[](https://circleci.com/gh/nwtgck/ibk)
Incremental Backup CLI with `tar`
## Motivation
We don't want to lose data. That is the biggest motivation to **backup**. In addition, we don't want to waste our storage by backups. That is the main reason to use an **incremental** backup.
Although an amazing file system such as ZFS supports snapshot functionality, every OS doesn't support it. Thus, `ibk` uses snapshot functionality of `tar` since `tar` is widely installed, used and matured. `ibk` assist you to backup incrementally using `tar` inside. This means **you can backup/restore with the natural `tar` command**.
## Requirements
### Linux
* `tar`
### macOS
* `brew install gnu-tar`
## Installation
Get binaries from [GitHub Releases](https://github.com/nwtgck/ibk/releases)
## Usage
### Backup
```bash
ibk backup ./mydir
```
Then, you have `mydir.ibk` directory which contains .tar and .snar files as follows.
- `./mydir.ibk/mydir_20190302_0757_21_407103_UTC.tar`
- `./mydir.ibk/mydir.snar`
You can also use `backup -b mybackup` or `backup --backup-path mybackup` to specify backup directory path not default `ooo.ibk`.
Specify `--local-time` to use local time not UTC.
### Incremental Backup
When you type the command again, the backup should be conducted incrementally.
```bash
ibk backup ./mydir
```
### Restore
```bash
ibk restore ./mydir.ibk/
```
Then, you have `ibk_restored` directory which contains the following hierarchy.
- `ibk_restored/mydir`
You can also use `restore -r myrestore` or `restore --restored-path myrestore` to specify restored directory path not default `ibk_restored`.
## Backup with only `tar`
(NOTE: You should replace `tar` with `gtar` in macOS)
```bash
# First backup
mkdir mybackup
tar -g ./mybackup/mydir.snar -cf ./mybackup/mydir_first.tar ./mydir
## Second backup (incremental)
tar -g ./mybackup/mydir.snar -cf ./mybackup/mydir_second.tar ./mydir
## Third backup (incremental)
tar -g ./mybackup/mydir.snar -cf ./mybackup/mydir_third.tar ./mydir
```
## Restore with only `tar`
```bash
cd mybackup
tar -g mydir.snar -xf mydir_first.tar
tar -g mydir.snar -xf mydir_second.tar
tar -g mydir.snar -xf mydir_third.tar
```
Then, you have `./mybackup/mydir`.