Elephant Backup is an easy backup CLI to archive any number of ZFS filesystems containing lots of snapshots to another ZFS filesystem.
Elephant Backup archives any number of ZFS filesystems containing lots of snapshots.
- Archive your ZFS filesystems staying snapshots as it is.
- Supports the incremental backup from the previous one.
- Show the difference between the current archive and the previous one.
- Take a one-shot snapshot and snapshots automatically every hour.
Development Site: https://github.com/patineboot/elephant-backup
Released Elephant Backup with npm
: https://www.npmjs.com/package/elephant-backup
npm install elephant-backup
Note:
Install npm
with the apt
package manager if npm
does not exist on Ubuntu.
Install node
with npm
and reboot after installing npm
.
apt install npm
npm --global install node
reboot
Archive ZFS filesystems, meaning ZFS pool or ZFS dataset, with the command line:
elephant-backup backup -a <archive filesystem> <primary filesystem...>
- <archive filesystem>: The name of the ZFS filesystem, which stores the primary ZFS filesystems.
- <primary filesystem...>: One or more names of the ZFS filesystem which are archived.
e.g., archive two of the primary ZFS pools named root.pool and storage.pool to the archive.pool archive ZFS pool.
sudo elephant-backup backup -a archive.pool root.pool storage.pool
Take snapshots automatically with the systemd
timer.
elephant-backup systemd-install <primary filesystem...>
- <primary filesystem>: One or more names of the ZFS filesystem which are taken automatically.
e.g., automatically take snapshots named root.pool and storage.pool.
-
Start to take snapshots automatically.
sudo elephant-backup systemd-install root.pool storage.pool
-
Stop taking snapshots automatically.
sudo elephant-backup systemd-uninstall
Find three sub-commands and two auto-snapshot by running the elephant-backup
command with the -h
option.
See more details using the -h
option with sub-command.
elephant-backup -h
elephant-backup backup -h
elephant-backup diff -h
elephant-backup snapshot -h
Elephant Backup runs on the following software environment or later versions.
Operating System:
- Ubuntu Server 22.04.1 LTS with OpenZFS 2.1.4 installed
Software Programs:
- node.js v18.6.0
I have developed Elephant Backup currently.
Will arrive the new feature:
- purging some existing snapshots from remaining size.
$ zfs list -o space -r rpool
NAME AVAIL USED USEDSNAP USEDDS USEDREFRESERV USEDCHILD
rpool 59.1G 7.84G 21K 109K 0 7.84G
rpool@snap1 - 21K - - - -
rpool/ROOT 59.1G 4.78G 0 31K 0 4.78G
rpool/ROOT@snap1 - 0 - - - -
The USED property of snapshots is the size which snapshot consume.
We estimate the volume size of the ZFS pool from the USED property of to be purged snapshot.
-
Install
-
Install the development version from a local directory.
Move the directory containing Elephant Backup, and install it.
cd working/elephant-backup npm install ../elephant-backup
-
Install the development version from GitHub.
npm install patineboot/elephant-backup
-
-
Run the development version.
sudo ./elephant-backup/src/main.js --help
Debug Elephant Backup with the remote debug.
e.g.,
- Remote Machine Name: ubuntu.local
- Elephant Backup Path on Remote: /home/patine/working/elephant-backup
The remote debug procedure:
-
Debug Machine: Change
remoteRoot
on the .vscode/launch.json file."remoteRoot": "/home/patine/working/elephant-backup"
-
Remote Machine: Run Elephant Backup with the debugging flag on node.js on the .
cd /home/patine/working/elephant-backup sudo node --inspect-brk=ubuntu.local src/main.js --help
-
Debug Machine: Select 'Attach to remote' on the Visual Studio Code.
Setup the test environment on your machine.
- Move the current directory to elephant-backup.
- Install
node.js
with version 18.0.0 or higher.
npm install node@18.9.0
Run the test.
- Move the current directory to elephant-backup.
- Run the test on the test environment.
npx node --test