Skip to content

Restic UI - User documentation

Restic UI
  • File menu

    Load file

    For each backup we store the following data in a JSON file.

    Backup Data

    • name
    • repository
    • source
    • password (*)
    • init
    • exclude (*)

    REST Data

    • REST Domain
    • REST Port
    • REST User
    • REST Password
    • REST Folder

    (*) optional

    Data Explanation
    BACKUP DATA
    name The name of the backup, this name must be unique
    repository The path of the backup
    source The path of the data to be saved
    password The Restic password used to encrypt the data
    init Status whether the backup has already been initialized. 1 = done 0 = not done
    exclude Path to exclude.txt
    REST DATA
    REST Domain Domain from REST-server example.com
    REST Port Port from REST-server
    REST User username from HTTP-user
    REST Password password from HTTP-user
    REST Folder Folder on REST-server for storing backup

    Open Repo (since 1.5.1)

    Every now and then I have a repo lying around here somewhere that I want to take a look at. Comes very often from testing. I want to take a look before I delete it.

    • For opening the repo the password is needed.
    • The data of the repo is attached to the backup_list.json.

    Now you can look inside, list snapshots and so on.

    What you can't do is a new backup. For that the source would have to be set first.

    Add backup

    Here we can create and save a backup

    cf27bad9-0435-4051-ba40-2ef14ee63603-image.png

    Edit backup

    Here we can edit and save a backup

    cdde6f32-af6b-4e30-a39c-30f6b9af5d3c-image.png

    1b103470-2aba-4bc7-b03d-c71d53f161db-image.png

    Delete backup

    With this menu we can delete a backup AND it's data!

    Restic menu

    Init

    We will use this restic command

    restic -r /home/frank/restic_test/ init
    

    Backup

    We will use this restic command

    restic -r /home/frank/restic_test/ backup /home/frank/Bilder --exclude-file=excludes.txt
    

    Mount

    We will use this restic command

    restic -r /home/frank/restic_test/ mount /tmp/restic
    

    UMount

    We will use this command

    umount mount_path
    

    Restore

    We will use this restic command

    restic -r /srv/restic-repo restore <ID> --target /tmp/restore-work
    

    You will be ask for a snapshot <ID>. Use Tools/Snapshots and copy and paste the <ID>

    Tools menu

    Snapshots

    We will use this restic command

    restic -r /home/frank/restic_test/ snapshots
    

    Example output

    reading repository password from stdin
    ID        Time                 Host           Tags        Paths
    ----------------------------------------------------------------------------
    af5080e4  2021-08-04 21:22:10  frank-MS-7C37              /home/frank/Bilder
    ----------------------------------------------------------------------------
    1 snapshots
    

    List Snapshot

    We will use this restic command

    restic -r /home/frank/restic_test/ ls <ID>
    

    Example output

    reading repository password from stdin
    snapshot af5080e4 of [/home/frank/Bilder] filtered by [] at 2021-08-04 21:22:10.320165238 +0200 CEST):
    /home
    /home/frank
    /home/frank/Bilder
    /home/frank/Bilder/20210603_161.zip
    /home/frank/Bilder/20210603_161548.jpg
    /home/frank/Bilder/20210603_161601.jpg
    /home/frank/Bilder/20210721_140856.jpg
    /home/frank/Bilder/20210722_101305.jpg
    /home/frank/Bilder/Bildschirmfoto vom 2021-06-15 17-39-09.png
    /home/frank/Bilder/Bildschirmfoto vom 2021-06-24 18-48-52.png
    /home/frank/Bilder/Bildschirmfoto vom 2021-06-24 18-49-55.png
    /home/frank/Bilder/Cinebar
    ............
    

    Check

    We will use this restic command

    restic -r /home/frank/restic_test/ check
    

    Unlock

    We will use this restic command

     restic -r /home/frank/restic_test/ unlock
    

    Stats

    We will use this restic command

    restic -r /home/frank/restic_test/ stats
    

    Prune

    We will use this restic command

    restic -r /home/frank/restic_test/ forget --keep-last 3 --keep-monthly 3 --prune
    

    Version

    We will use this command

    restic version
    

    Settings

    Here you can store

    Tab Encryption

    crypt.png

    Tab Paths

    • home path
    • source path
    • exclude list
    • Key Path

    path.png

    Tab Restic Settings

    Here we can set some restic parameters

    • check --read-data subset 75%

    Then restic will only load 75% from data to check

    • prune keep last (0 - 9)
    • prune keep monthly (0 - 12)

    --keep-last n never delete the n last (most recent) snapshots
    --keep-monthly n for the last n months which have one or more snapshots, only keep the last one for that month.
    Quelle: https://restic.readthedocs.io/en/latest/060_forget.html

    restic.png

    Migrate menu

    Since restic version 0.14.0 compression has been added.

    The repo format has changed.

    There is the restic migrate command to migrate old repos V1 to V2.

    For this there is a new menu 'Migrate' with two commands

    migrate check and migrate update

    Migrate Check

    Migrate check will show available migrations for the repo.

    Migrate Update

    Attention. I am using

    export RESTIC_PASSWORD="I9n7G7G0ZpDWA3GOcJbIuwQCGvGUBkU5"
    

    because migrate update expects a password entry twice.

    Migrate Update will change repo version from V1 to V2. No data will be compressed, only with a new backup the data will be saved compressed.

    For more infos read -> https://linux-nerds.org/topic/1257/restic-ui-migrate

    Help menu

    About Restic UI

    2e1aff87-1541-473f-affa-ccbbcccf5028-image.png

    Restic documentation

    Restic documentation you can read here

    Translated with www.DeepL.com/Translator (free version)

  • Python3 - enumerate()

    Python3
    2
    0 Stimmen
    2 Beiträge
    88 Aufrufe
    FrankMF

    Ich habe noch was Code gefunden, den ich mal dringend aufräumen musste 🙂 Wenn ich mit dem Restic UI die Snapshots anzeige, dann sieht das so aus.

    reading repository password from stdin ID Time Host Tags Paths ---------------------------------------------------------------------------- 4e769748 2021-12-31 21:48:34 frank-MS-7C37 /home/frank/Bilder 34298934 2022-01-26 20:15:53 frank-MS-7C37 /home/frank/Bilder 0d5d88f2 2022-01-27 21:05:07 frank-MS-7C37 /home/frank/Bilder f0e7d5a7 2022-01-29 13:46:12 frank-MS-7C37 /home/frank/Bilder 79918d70 2022-01-29 13:52:56 frank-MS-7C37 /home/frank/Bilder d74272a3 2022-01-30 11:54:20 frank-MS-7C37 /home/frank/Bilder 11b0b5ad 2022-01-30 11:57:44 frank-MS-7C37 /home/frank/Bilder 4a7450d2 2022-02-20 09:35:56 frank-MS-7C37 /home/frank/Bilder c1a4a51d 2022-02-20 09:36:43 frank-MS-7C37 /home/frank/Bilder d178ded5 2022-02-20 09:38:53 frank-MS-7C37 /home/frank/Bilder 997e2259 2022-02-20 16:35:57 frank-MS-7C37 /home/frank/Bilder 3320ad5c 2022-02-20 16:49:19 frank-MS-7C37 /home/frank/Bilder ---------------------------------------------------------------------------- 12 snapshots

    Mich interessieren die IDs, weil ich bei der Eingabe der IDs überprüfen möchte, ob die eingegebene ID existiert. Also muss ich das irgendwie auslesen und speichern. Das habe ich bis jetzt so gemacht.

    def id_append(self, result): # We split the result into individual lines. # Result was passed. And create an list. result_list = result.split('\n') # We count the number of repositories and search for 'source'. count = result.count(backup_data[row].source) # Offset added, first interesting line is line 3! count = count + 3 # We loop through the list and output the ID's and store in snapshot_id x = 3 while x < count: a = result_list[x] y = a[0:8] snapshot_id.append(y) x = x + 1

    Das erschien mir heute, beim erneuten Betrachten, Spaghetticode zu sein. Machen wir das mal etwas ordentlicher.

    Ich nehme die Ausgabe (stdout) und erzeuge eine Liste, jede Zeile ein Element.

    result_list = result.split('\n')

    Sieht so aus

    ['reading repository password from stdin', 'ID Time Host Tags Paths', '----------------------------------------------------------------------------', '4e769748 2021-12-31 21:48:34 frank-MS-7C37 /home/frank/Bilder', '34298934 2022-01-26 20:15:53 frank-MS-7C37 /home/frank/Bilder', '0d5d88f2 2022-01-27 21:05:07 frank-MS-7C37 /home/frank/Bilder', 'f0e7d5a7 2022-01-29 13:46:12 frank-MS-7C37 /home/frank/Bilder', '79918d70 2022-01-29 13:52:56 frank-MS-7C37 /home/frank/Bilder', 'd74272a3 2022-01-30 11:54:20 frank-MS-7C37 /home/frank/Bilder', '11b0b5ad 2022-01-30 11:57:44 frank-MS-7C37 /home/frank/Bilder', '4a7450d2 2022-02-20 09:35:56 frank-MS-7C37 /home/frank/Bilder', 'c1a4a51d 2022-02-20 09:36:43 frank-MS-7C37 /home/frank/Bilder', 'd178ded5 2022-02-20 09:38:53 frank-MS-7C37 /home/frank/Bilder', '997e2259 2022-02-20 16:35:57 frank-MS-7C37 /home/frank/Bilder', '3320ad5c 2022-02-20 16:49:19 frank-MS-7C37 /home/frank/Bilder', '----------------------------------------------------------------------------', '12 snapshots', '']

    Diesmal benutzen wir die enumerate() Funktion

    for count, value in enumerate(result_list): print(count, value)

    Das was raus kommt, sieht so aus

    0 reading repository password from stdin 1 ID Time Host Tags Paths 2 ---------------------------------------------------------------------------- 3 4e769748 2021-12-31 21:48:34 frank-MS-7C37 /home/frank/Bilder 4 34298934 2022-01-26 20:15:53 frank-MS-7C37 /home/frank/Bilder 5 0d5d88f2 2022-01-27 21:05:07 frank-MS-7C37 /home/frank/Bilder 6 f0e7d5a7 2022-01-29 13:46:12 frank-MS-7C37 /home/frank/Bilder 7 79918d70 2022-01-29 13:52:56 frank-MS-7C37 /home/frank/Bilder 8 d74272a3 2022-01-30 11:54:20 frank-MS-7C37 /home/frank/Bilder 9 11b0b5ad 2022-01-30 11:57:44 frank-MS-7C37 /home/frank/Bilder 10 4a7450d2 2022-02-20 09:35:56 frank-MS-7C37 /home/frank/Bilder 11 c1a4a51d 2022-02-20 09:36:43 frank-MS-7C37 /home/frank/Bilder 12 d178ded5 2022-02-20 09:38:53 frank-MS-7C37 /home/frank/Bilder 13 997e2259 2022-02-20 16:35:57 frank-MS-7C37 /home/frank/Bilder 14 3320ad5c 2022-02-20 16:49:19 frank-MS-7C37 /home/frank/Bilder 15 ---------------------------------------------------------------------------- 16 12 snapshots 17

    Mich interessieren nur die Zeilen mit /home/frank/Bilder Das kann man so abfragen

    if backup_data[row].source in value:

    Und jetzt nur die ID entsprechend abspeichern

    snapshot_id.append(value[0:8])

    Sieht jetzt komplett so aus

    result_list = result.split('\n') for count, value in enumerate(result_list): if backup_data[row].source in value: snapshot_id.append(value[0:8]) print(count, value[0:8])

    Somit speichert er jetzt nur noch die IDs, der folgenden Ausgabe.

    3 4e769748 4 34298934 5 0d5d88f2 6 f0e7d5a7 7 79918d70 8 d74272a3 9 11b0b5ad 10 4a7450d2 11 c1a4a51d 12 d178ded5 13 997e2259 14 3320ad5c

    Diese IDs, kann ich dann weiterverarbeiten.

  • Restic UI - auf PyQt6 umbauen

    Restic UI
    5
    0 Stimmen
    5 Beiträge
    184 Aufrufe
    FrankMF

    Ich hatte im Python Forum mal um Hilfe gebeten und man hat mir einen Hinweis gegeben, dem ich hier mal nachgehe.

    Der Forenuser meinte, das es ihn wundern würde, wenn ich von QtCore importieren müsste, also

    self.addDockWidget(QtCore.Qt.DockWidgetArea.RightDockWidgetArea, self.items)

    Das habe ich mal ausprobiert. Wenn ich von QtCore Qt importiere, kann ich das QtCore weglassen.

    from PyQt6.QtCore import QSettings, Qt

    dann geht auch

    self.addDockWidget(Qt.DockWidgetArea.RightDockWidgetArea, self.items)

    Es sieht so aus, das ich mich in dieses Thema noch ein wenig einarbeiten muss 🙂

  • 0 Stimmen
    1 Beiträge
    129 Aufrufe
    Niemand hat geantwortet
  • 0 Stimmen
    2 Beiträge
    180 Aufrufe
    FrankMF

    Die REST Unterstützung ist komplett 🤓

    Link Preview Image Not Found

    favicon

    (gitlab.com)

    Ich denke, ein wenig Dokumentation wäre noch gut ☺

  • Restic UI - Changelog

    Angeheftet Restic UI
    3
    0 Stimmen
    3 Beiträge
    262 Aufrufe
    FrankMF

    v1.5.0 - Release for restic v0.14.0 with compression and migration tool

  • Restic UI - Released

    Restic UI
    1
    0 Stimmen
    1 Beiträge
    141 Aufrufe
    Niemand hat geantwortet
  • Python3 - QT_QPA_PLATFORM

    Python3
    2
    0 Stimmen
    2 Beiträge
    284 Aufrufe
    FrankMF

    Nachdem ich ja mittlerweile schon lange weder auf Cinnamon bin, hatte ich nach einem Update von VSCodium wieder ein anderes Design. Ok, schauen wir rein.

    (venv) frank@frank-MS-7C37:~/restic-ui-public$ env | grep "QT" QT_ACCESSIBILITY=1 QT_QPA_PLATFORMTHEME=qt5ct

    Wenn ich das auf

    QT_QPA_PLATFORMTHEME=gnome3

    ändere, sieht es wie auf meinem Linux Mint Cinnamon Desktop aus.

  • Python3 - Eingabeformular

    Python3
    3
    0 Stimmen
    3 Beiträge
    191 Aufrufe
    FrankMF

    Meine endgültige Lösung, zu mindestens im Moment 😉 , ist ein zweites Window. Das gefällt mir am Besten, komme ich zu mindestens im Moment einfach besser mit klar. Aber, eines der größten Probleme war für mich, wie aktualisiere ich die Liste im Hauptfenster!? Da habe ich doch etliche Stunden dran rum gefummelt....

    Hier nur mal das Layout

    ##################### # Layout ##################### self.formGroupBox = QGroupBox("Form layout") layout = QFormLayout() layout.addRow(self.label_1) layout.addRow(QLabel("Backup Name:"), self.input1) layout.addRow(QLabel("Repository:"), self.button3) layout.addRow(QLabel("Source:"), self.button4) layout.addRow(QLabel("Password:"), self.input4) layout.addRow(self.label_6) layout.addRow(self.button2) self.formGroupBox.setLayout(layout) self.setLayout(layout)

    Das mit dem SecondWindow ist aber was aufwändiger. Da mach ich dann mal einen eigenen Beitrag zu. Aktuell sieht das so aus.

    6c68c956-9127-438f-bc54-4dcef8e18f00-image.png