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)

  • Restic UI - Stand Januar 2023

    PyWebIO
    1
    0 Stimmen
    1 Beiträge
    100 Aufrufe
    Niemand hat geantwortet
  • 0 Stimmen
    3 Beiträge
    165 Aufrufe
    FrankMF

    Hallo @berthold, du bist mein einziger Star 🙂 Ok, darum geht es mir ja nicht, wie Du weißt mache ich das hauptsächlich für mich und meine Backups klappen damit sehr gut. Ist also produktiv einsetzbar.

    Wie Du gemerkt hast, gibt es Zeiten da mache ich ganz viel und dann wieder Zeiten da passiert nix. Das ist bei mir normal, ich muss da "Bock" drauf haben. Habe ich viel Stress auf der Arbeit, passiert Abends eher sehr wenig..

    Ich hoffe das ich mittlerweile alle Fehler gefunden habe, die Grundfunktionen sind alle funktional. Mittlerweile kann man die JSON Datei mit den Daten der Backups auf Wunsch auch verschlüsseln 🙂

    Ich habe noch eine ganze Reihe an Notizen, was ich gerne noch machen möchte. Wichtig ist mir aber im Moment, das ich alle Fehler finde und das so wie es jetzt ist, einwandfrei läuft.

    Darum, wenn es jemand nutzt, bitte gebt Feedback. Egal ob positiv oder negativ. Ich freue mich persönlich natürlich mehr über positives Feedback 🙂

  • 0 Stimmen
    2 Beiträge
    207 Aufrufe
    FrankMF

    Der Autor hat meine Anpassungen um ein paar Änderungen erweitert und in sein Repo eingepflegt. Der QtWaitingSpinenr ist jetzt auch 3.10 kompatibel 🤓

    1b268980-92ca-42a4-89a0-a6e4b7ab9378-grafik.png

  • 0 Stimmen
    1 Beiträge
    129 Aufrufe
    Niemand hat geantwortet
  • PyQt5 - QThread

    Python3
    3
    0 Stimmen
    3 Beiträge
    140 Aufrufe
    FrankMF

    Und hier mal ein komplettes Beispiel.

    class Worker

    Wir legen den Worker an, das ist der Prozess der die Arbeit macht und etwas länger braucht.

    class Worker(QObject): """ Worker Class for Rest function stats""" stats_finished = pyqtSignal(str) stats_error = pyqtSignal(str) def __init__(self): super().__init__() def run(self): # Restic function try: # long running task except Exception: # Process don't successful, send signal self.stats_error.emit(result.stderr) else: # Process successful, send signal self.stats_finished.emit(result.stdout) finally: pass in class MainWindow class MainWindow(QMainWindow): def __init__(self): super().__init__() "First Thread with documentation" # Worker for restic_stats # Create a QThread object self.thread = QThread() # Create a worker object self.worker1 = Worker() # Move worker to the thread self.worker1.moveToThread(self.thread) # Connect signals and slots self.thread.started.connect(self.worker1.run) self.worker1.stats_finished[str].connect(self.restic_stats_finished) self.worker1.stats_error[str].connect(self.restic_stats_error) "First thread end" ############################################### # Process for restic_stats is finished ############################################### @pyqtSlot(str) def restic_stats_finished(self, i): # Signal from worker thread without an error Spinner.stop(self) self.thread.quit() ############################################### # Process for restic_stats when get an error ############################################### @pyqtSlot(str) def restic_stats_error(self, i): # Signal from worker thread with an error! Spinner.stop(self) Funktion restic_stats def restic_stats(self): # we start the worker thread self.thread.start() # we start waitingspinnerwidget Spinner.start(self)

    Ich wollte gerade schreiben, das folgendes sehr wichtig ist

    self.thread.quit()

    da fällt mir ein Fehler auf. Kurz ausprobiert und bingo, wenn der Prozess einen Error triggert, muss natürlich auch der Prozess beendet werden. Wenn man das nicht macht, macht das Programm nicht das was es soll. Der Grund ist, das der Prozess einfach immer weiter läuft. Er MUSS beendet werden. Ich gehe dann mal in meinem Programm alles ändern 🙂

    Ok, jetzt geht die Funktion auch zweimal hintereinander und gibt auch ordentlich den Fehler aus.

    Fazit

    Ich habe wieder sehr viel gelernt und hoffe das ich es auch richtig verstanden habe 😉 Hoffe das es dem ein oder anderen Anfänger hilft. Und falls hier ein Profi mitliest und hier Blödsinn steht bitte ich um einen Kommentar, damit ich das ändern kann. Es steht schon genug Blödsinn im Netz 🙂

  • Restic UI - Documentation

    Restic UI
    1
    0 Stimmen
    1 Beiträge
    204 Aufrufe
    Niemand hat geantwortet
  • 0 Stimmen
    5 Beiträge
    722 Aufrufe
    FrankMF

    @berthold Hallo Berthold. Ich bin eigentlich immer noch nicht mit meinem Code zufrieden. Ist man das jemals? Da ich auch noch ein kleines Problem habe, würde ich da ungerne jemanden reinschauen lassen. Der Code ist stellenweise in deutsch kommentiert, stellenweise in englisch. Kennt man ja, man will es irgendwann mal ordentlich machen und dann kommt das nächste Problem auf einen zu.

    Hast Du Python3 Vorkenntnisse? Wenn Du "brennend" dran interessiert bist, könnte ich Dir evt. Zugang zu meinem Gitlab-Projekt geben.

    Wenn Du interessiert bist und ich dich nicht los werde :), dann schreib mir eine PN.

  • Python3 - JSON

    Python3
    3
    0 Stimmen
    3 Beiträge
    188 Aufrufe
    FrankMF

    ede1a88a-5183-4f85-a602-27650362d532-grafik.png

    Die Backups sollen Namen haben, also habe ich das erweitert. Jetzt sollen diese als Liste rechts angezeigt werden. Das mache ich wie folgt.

    for key in backups: print(backups[key]['name'], key) liste = backups[key]['name'] + " ID: " + key self.listWidget.addItem(liste)

    Mittels des Keys kann ich auf den Namen zugreifen und die Liste damit füllen. Aktuell habe ich noch den Key hinten angefügt, weil ich noch keine Idee habe, wie ich die Backups anders verarbeiten soll. Aber, Stück für Stück. Der Backup-Name wird nach Auswahl in der Statusbar angezeigt. So weit klappt das so wie ich mir das vorstelle. Für heute ist Feierabend 😇