Backsnap: Call for Testers

In an effort to revise the program backsnap , I created a test program.

Backsnap saves (now) btrfs snapshots from a PC to an attached hard drive. At the moment the program must be called separately for each subvolume in order to save the snapshots of this subvolume. The information about the snapshots is then collected via “ls …”.

Although this basically works fine, I would like to change the information retrieval so that it is done via “btrfs” commands. This way the program has a better overview of what is happening and gets more information about the snapshots that are available.

I’ve finished the part of the program for gathering the information about subvolumes and snapshots of the PC.

I would like to know if the approach works well enough when encountering different btrfs layouts. There is the “suse-snapper-layout”, the “manjaro-timeshift-layout”, and certainly countless others. (flat, nested, mixed …)

If you want to help me, please test whether the program captures your btrfs layout correctly and assigns the snapshots correctly.

:warning: This Testprogramm will not backup any snapshots!
It will only analyse the btrfs-layout, and print out its findings

You need to download the jar

wget https://github.com/andreaskielkopf/BackSnap/raw/gui/backsnapTest.jar
md5sum ./backsnapTest.jar

This should result in 34df0f22a98cd0c6635433e49052acfb ./backsnapTest.jar
(This jarfile contains the complete java-source of the Test)

You need to have java 17 installed and enabled

pacman -S jdk17-openjdk
sudo archlinux-java set java-17-openjdk

On my PC testing the programm looks looks like this:

java -jar ./backsnapTest.jar                                                                                            
sudo btrfs subvolume list -spcguqR /
[sudo] Passwort für andreas: 

sudo mount|grep btrfs
sudo btrfs subvolume show /
sudo btrfs subvolume show /.snapshots
sudo btrfs subvolume show /var/nosnap
sudo btrfs subvolume show /home
sudo btrfs subvolume show /var/cache
ERROR: Not a Btrfs subvolume: Invalid argument
sudo btrfs subvolume show /var/spool
ERROR: Not a Btrfs subvolume: Invalid argument
sudo btrfs subvolume show /var/nosnap/.snapshots
sudo btrfs subvolume show /home/.snapshots
sudo btrfs subvolume show /mnt/BACKUP

Found snapshots for: /
 -> @snapshots/24850/snapshot -> ...24850
 -> @snapshots/25254/snapshot -> ...25254
 -> @snapshots/25730/snapshot -> ...25730
 -> @snapshots/26256/snapshot -> ...26256
 -> @snapshots/26270/snapshot -> ...26270
 -> @snapshots/26383/snapshot -> ...26383
 -> @snapshots/26487/snapshot -> ...26487
 -> @snapshots/26619/snapshot -> ...26619
 -> @snapshots/26716/snapshot -> ...26716
 -> @snapshots/26764/snapshot -> ...26764
 -> @snapshots/26842/snapshot -> ...26842
 -> @snapshots/26949/snapshot -> ...26949
 -> @snapshots/27062/snapshot -> ...27062
 -> @snapshots/27089/snapshot -> ...27089
 -> @snapshots/27090/snapshot -> ...27090
 -> @snapshots/27091/snapshot -> ...27091
 -> @snapshots/27092/snapshot -> ...27092
 -> @snapshots/27093/snapshot -> ...27093
 -> @snapshots/27095/snapshot -> ...27095
 -> @snapshots/27096/snapshot -> ...27096
 -> @snapshots/27100/snapshot -> ...27100
 -> @snapshots/27101/snapshot -> ...27101
 -> @snapshots/27102/snapshot -> ...27102
 -> @snapshots/27103/snapshot -> ...27103
 -> @snapshots/27104/snapshot -> ...27104
 -> @snapshots/27119/snapshot -> ...27119
 -> @snapshots/27131/snapshot -> ...27131
 -> @snapshots/27161/snapshot -> ...27161
 -> @snapshots/27182/snapshot -> ...27182
 -> @snapshots/27183/snapshot -> ...27183
 -> @snapshots/27184/snapshot -> ...27184
 -> @snapshots/27185/snapshot -> ...27185
 -> @snapshots/27186/snapshot -> ...27186
 -> @snapshots/27187/snapshot -> ...27187
 -> @snapshots/27188/snapshot -> ...27188
 -> @snapshots/27189/snapshot -> ...27189
 -> @snapshots/27190/snapshot -> ...27190
 -> @snapshots/27191/snapshot -> ...27191
 -> @snapshots/27192/snapshot -> ...27192
 -> @snapshots/27202/snapshot -> ...27202
 -> @snapshots/27203/snapshot -> ...27203
 -> @snapshots/27216/snapshot -> ...27216
 -> @snapshots/27217/snapshot -> ...27217
 -> @snapshots/27232/snapshot -> ...27232
 -> @snapshots/27233/snapshot -> ...27233
 -> @snapshots/27234/snapshot -> ...27234
 -> @snapshots/27249/snapshot -> ...27249
 -> @snapshots/27250/snapshot -> ...27250
 -> @snapshots/27263/snapshot -> ...27263
 -> @snapshots/27264/snapshot -> ...27264
 -> @snapshots/27265/snapshot -> ...27265
 -> @snapshots/27266/snapshot -> ...27266
 -> @snapshots/27280/snapshot -> ...27280
 -> @snapshots/27281/snapshot -> ...27281
 -> @snapshots/27282/snapshot -> ...27282
 -> @snapshots/27283/snapshot -> ...27283
 -> @snapshots/27285/snapshot -> ...27285
 -> @snapshots/27288/snapshot -> ...27288
 -> @snapshots/27289/snapshot -> ...27289
 -> @snapshots/27299/snapshot -> ...27299
 -> @snapshots/27300/snapshot -> ...27300
 -> @snapshots/27301/snapshot -> ...27301
 -> @snapshots/27302/snapshot -> ...27302
 -> @snapshots/27303/snapshot -> ...27303
 -> @snapshots/27304/snapshot -> ...27304
 -> @snapshots/27305/snapshot -> ...27305
 -> @snapshots/27306/snapshot -> ...27306
 -> @snapshots/27307/snapshot -> ...27307
 -> @snapshots/27308/snapshot -> ...27308
 -> @snapshots/27309/snapshot -> ...27309
 -> @snapshots/27310/snapshot -> ...27310
 -> @snapshots/27311/snapshot -> ...27311
 -> @snapshots/27312/snapshot -> ...27312
 -> @snapshots/27313/snapshot -> ...27313
 -> @snapshots/27314/snapshot -> ...27314
 -> @snapshots/27315/snapshot -> ...27315
 -> @snapshots/27316/snapshot -> ...27316
 -> @snapshots/27317/snapshot -> ...27317
 -> @snapshots/27318/snapshot -> ...27318
 -> @snapshots/27319/snapshot -> ...27319
 -> @snapshots/27320/snapshot -> ...27320
 -> @snapshots/27321/snapshot -> ...27321
Found snapshots for: /home
 -> @home.snapshots/18338/snapshot -> ...18338
 -> @home.snapshots/18351/snapshot -> ...18351
 -> @home.snapshots/18431/snapshot -> ...18431
 -> @home.snapshots/18523/snapshot -> ...18523
 -> @home.snapshots/18612/snapshot -> ...18612
 -> @home.snapshots/18698/snapshot -> ...18698
 -> @home.snapshots/18742/snapshot -> ...18742
 -> @home.snapshots/18794/snapshot -> ...18794
 -> @home.snapshots/18881/snapshot -> ...18881
 -> @home.snapshots/18978/snapshot -> ...18978
 -> @home.snapshots/19058/snapshot -> ...19058
 -> @home.snapshots/19079/snapshot -> ...19079
 -> @home.snapshots/19089/snapshot -> ...19089
 -> @home.snapshots/19102/snapshot -> ...19102
 -> @home.snapshots/19117/snapshot -> ...19117
 -> @home.snapshots/19132/snapshot -> ...19132
 -> @home.snapshots/19145/snapshot -> ...19145
 -> @home.snapshots/19159/snapshot -> ...19159
 -> @home.snapshots/19172/snapshot -> ...19172
 -> @home.snapshots/19173/snapshot -> ...19173
 -> @home.snapshots/19174/snapshot -> ...19174
 -> @home.snapshots/19175/snapshot -> ...19175
 -> @home.snapshots/19176/snapshot -> ...19176
 -> @home.snapshots/19177/snapshot -> ...19177
 -> @home.snapshots/19178/snapshot -> ...19178
 -> @home.snapshots/19179/snapshot -> ...19179
 -> @home.snapshots/19180/snapshot -> ...19180
 -> @home.snapshots/19181/snapshot -> ...19181
 -> @home.snapshots/19182/snapshot -> ...19182
 -> @home.snapshots/19183/snapshot -> ...19183
 -> @home.snapshots/19184/snapshot -> ...19184
 -> @home.snapshots/19185/snapshot -> ...19185
 -> @home.snapshots/19186/snapshot -> ...19186
 -> @home.snapshots/19187/snapshot -> ...19187
 -> @home.snapshots/19188/snapshot -> ...19188
 -> @home.snapshots/19189/snapshot -> ...19189
 -> @home.snapshots/19190/snapshot -> ...19190
 -> @home.snapshots/19191/snapshot -> ...19191
Found snapshots for: /var/nosnap
 -> @nosnap.snapshots/15/snapshot -> ......15
 -> @nosnap.snapshots/16/snapshot -> ......16
 -> @nosnap.snapshots/17/snapshot -> ......17
 -> @nosnap.snapshots/18/snapshot -> ......18
 -> @nosnap.snapshots/19/snapshot -> ......19
 -> @nosnap.snapshots/20/snapshot -> ......20
 -> @nosnap.snapshots/21/snapshot -> ......21
 -> @nosnap.snapshots/22/snapshot -> ......22
 -> @nosnap.snapshots/23/snapshot -> ......23
 -> @nosnap.snapshots/24/snapshot -> ......24
 -> @nosnap.snapshots/25/snapshot -> ......25
 -> @nosnap.snapshots/26/snapshot -> ......26
  • The program will printout all commands it executes
  • All subvolumes that have snapshots must be found
  • It must show all related snapshots
    Presumably only snapshots can be found that are currently “accessible = somehow mounted”.

:footprints: