Skip to content

NormalBackupOperations

Luca Finzi Contini edited this page Oct 27, 2024 · 4 revisions

Normal Backup Operations

So far we have seen just the first backup.

Here is a list of normal backup situations that needs to be covered.

Add / modify / delete files and then backup

Here is an example execution of zfs-backup.sh -b ExampleDocuments where some files have been added, modified, and deleted:

user@nas:~/src/zfs-backup$ ./zfs-backup.sh -b ExampleDocuments

####################################################################################################
                 ZFS Backup Script - server name = nas
####################################################################################################

Starting Zfs Backup - Backup operation requested.
Backing up zfspool/Documents to remote server backup as remote user buser on backuppool/DocumentsBackup
Latest Snapshot is zfspool/Documents@2024.07.26-00.48.47
Finding differences between zfspool/Documents@2024.07.26-00.48.47 and current status of zfspool/Documents - this could take some time...
There are differences -> creating a snapshot...
Creating snapshot...
Snapshot performed correctly: zfspool/Documents@2024.08.06-23.17.00

Current local snapshot = zfspool/Documents@2024.08.06-23.17.00

The dataset "DocumentsBackup" is already present in the REMOTE backup system.
Retrieving mountpoint for remote backup system dataset...
Remote backup system dataset mountpoint is: /mnt/storage
source pool             = zfspool
source dataset          = Documents
---
destination address     = backup
destination username    = buser
destination pool        = backuppool
destination dataset     = DocumentsBackup
####################################################################################################
=== Checking snapshot alignment between REMOTE and LOCAL systems
Last snapshot date on REMOTE system is : 2024.07.26-00.48.47
Last snapshot date on LOCAL  system is : 2024.08.06-23.17.00
There is a snapshot with the same date on LOCAL system.
Finding all modifications from zfspool/Documents@2024.07.26-00.48.47 to zfspool/Documents@2024.08.06-23.17.00...
Determining changed files...
Determining moved files...
Determining deleted files...
There are 1 changed files, 6 deleted files and 1 moved files.
Remote is aligned with local? false
Calculating md5sums parallelizing 4x...

Computers / CPU cores / Max jobs to run
1:local / 2 / 2

Computer:jobs running/jobs completed/%of started jobs/Average seconds to complete
ETA: 0s Left: 0 AVG: 0.00s  local:0/1/100%/0.0s
Fixing paths in md5sums file...
Substituting Documents with DocumentsBackup in md5sums file...
Calculating data transfer size approximation...
Approximate transfer size is 512
Sending snapshot...
receiving incremental stream of zfspool/Documents@2024.08.06-23.17.00 into backuppool/DocumentsBackup@2024.08.06-23.17.00
 130KiB 0:00:00 [ 172KiB/s] [ 172KiB/s] [==============================================================================================================] 26056%
received 129K stream in 0.09 seconds (1.41M/sec)
Sending md5sums file to remote system...
md5-DocumentsBackup.txt                                                                                                                  100%   62    60.1KB/s   00:00
Checking remote md5sums, please wait...
DocumentsBackup/NewFile.txt: OK
remote md5sum are correct.
Backup operations completed successfully.
user@nas:~/src/zfs-backup$

Of course, with such tiny modifications, the approximate transfer size is hugely underestimated, but you get the idea.

Here is the new list of snapshots on the nas machine:

user@nas:~/src/zfs-backup$ zfs list -t snapshot
NAME                                    USED  AVAIL  REFER  MOUNTPOINT
zfspool/Documents@2024.07.26-00.48.47   789K      -   474M  -
zfspool/Documents@2024.08.06-23.17.00  74.6K      -   473M  -
user@nas:~/src/zfs-backup$

And this is the new list of snapshots on the backup machine:

buser@backup:~$ zfs list -t snapshot
NAME                                             USED  AVAIL  REFER  MOUNTPOINT
backuppool/DocumentsBackup@2024.07.26-00.48.47   744K      -   474M  -
backuppool/DocumentsBackup@2024.08.06-23.17.00     0B      -   473M  -
buser@backup:~$

Here what the "Previous Versions" tabs look like for both nas and backup:

First 2 snapshots of both NAS and BACKUP

Opening two different nas snapshots in Windows

Here you can see that the dates are different. Files in red in the first snapshot have been deleted and do not appear in the second snapshot. There is a modified file in yellow. The new file is circled in green.

First two snapshots - differences from NAS

Opening two different backup snapshots in Windows

Same thing as before, but opening the two snapshots on the backup server:

First two snapshots - differences from BACKUP

Now let's see a different usage: no backup server involved, just a local NAS with several snapshots -> head on to Local Snapshots Only

Clone this wiki locally