Skip to content

Rest-Server

Verschoben Restic
  • Was das?

    Rest Server is a high performance HTTP server that implements restic's REST backend API. It provides secure and efficient way to backup data remotely, using restic backup client via the rest: URL.

    Installation

    Mittels git das Repo clonen.

    root@rockpro64:~# git clone https://github.com/restic/rest-server.git
    Cloning into 'rest-server'...
    remote: Enumerating objects: 3, done.
    remote: Counting objects: 100% (3/3), done.
    remote: Compressing objects: 100% (3/3), done.
    remote: Total 3180 (delta 0), reused 2 (delta 0), pack-reused 3177
    Receiving objects: 100% (3180/3180), 5.63 MiB | 2.39 MiB/s, done.
    Resolving deltas: 100% (1189/1189), done.
    

    In das Verzeichnis wechseln und mittels go das File bauen. Moment, go fehlt uns noch.

    apt install golang-go
    

    Danach

     cd rest-server
    

    File bauen

    root@rockpro64:~/rest-server# go run build.go
    go: finding github.com/prometheus/client_golang v0.8.0
    go: finding github.com/prometheus/procfs v0.0.0-20180212145926-282c8707aa21
    go: finding github.com/beorn7/perks v0.0.0-20160804104726-4c0e84591b9a
    go: finding github.com/golang/protobuf v1.0.0
    go: finding github.com/gorilla/handlers v1.3.0
    go: finding github.com/inconshreveable/mousetrap v1.0.0
    go: finding github.com/miolini/datacounter v0.0.0-20171104152933-fd4e42a1d5e0
    go: finding golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a
    go: finding golang.org/x/crypto v0.0.0-20180214000028-650f4a345ab4
    go: finding github.com/spf13/pflag v1.0.0
    go: finding github.com/matttproud/golang_protobuf_extensions v1.0.0
    go: finding github.com/spf13/cobra v0.0.1
    go: finding github.com/prometheus/client_model v0.0.0-20171117100541-99fa1f4be8e5
    go: finding github.com/prometheus/common v0.0.0-20180110214958-89604d197083
    go: finding goji.io v2.0.2+incompatible
    go: downloading github.com/spf13/cobra v0.0.1
    go: downloading github.com/gorilla/handlers v1.3.0
    go: downloading goji.io v2.0.2+incompatible
    go: downloading golang.org/x/crypto v0.0.0-20180214000028-650f4a345ab4
    go: downloading github.com/prometheus/client_golang v0.8.0
    go: downloading github.com/miolini/datacounter v0.0.0-20171104152933-fd4e42a1d5e0
    go: downloading github.com/spf13/pflag v1.0.0
    go: downloading github.com/prometheus/common v0.0.0-20180110214958-89604d197083
    go: downloading github.com/prometheus/client_model v0.0.0-20171117100541-99fa1f4be8e5
    go: downloading github.com/golang/protobuf v1.0.0
    go: downloading github.com/prometheus/procfs v0.0.0-20180212145926-282c8707aa21
    go: downloading github.com/beorn7/perks v0.0.0-20160804104726-4c0e84591b9a
    go: downloading github.com/matttproud/golang_protobuf_extensions v1.0.0
    

    Das resultierende File rest-server an seinen Platz verschieben.

    cp rest-server /usr/local/bin   
    

    Test

    root@rockpro64:/# rest-server --help
    Run a REST server for use with restic
    
    Usage:
      rest-server [flags]
    
    Flags:
          --append-only          enable append only mode
          --cpu-profile string   write CPU profile to file
          --debug                output debug messages
      -h, --help                 help for rest-server
          --listen string        listen address (default ":8000")
          --log string           log HTTP requests in the combined log format
          --max-size int         the maximum size of the repository in bytes
          --no-auth              disable .htpasswd authentication
          --path string          data directory (default "/tmp/restic")
          --private-repos        users can only access their private repo
          --prometheus           enable Prometheus metrics
          --tls                  turn on TLS support
          --tls-cert string      TLS certificate path
          --tls-key string       TLS key path
      -V, --version              output version and exit
    

    Gut, das Programm läuft 🙂

    Rest-Server starten

    root@rockpro64:/# rest-server --path /home/rock64/backup --no-auth
    Data directory: /home/rock64/backup
    Authentication disabled
    Private repositories disabled
    Starting server on :8000
    

    OK, der Rest-Server läuft. Dann mal ausprobieren.

    Backup erstellen und Test

    Init

    root@frank-MS-7C37:~# restic -r rest:http://192.168.3.11:8000/ init
    enter password for new repository: 
    enter password again: 
    created restic repository 394364201c at rest:http://192.168.3.11:8000/
    
    Please note that knowledge of your password is required to access
    the repository. Losing your password means that your data is
    irrecoverably lost.
    

    backup

    root@frank-MS-7C37:~# restic -r rest:http://192.168.3.11:8000/ backup /home/frank/Dokumente/
    enter password for repository: 
    repository 39436420 opened successfully, password is correct
    created new cache in /root/.cache/restic
    
    Files:          27 new,     0 changed,     0 unmodified
    Dirs:            2 new,     0 changed,     0 unmodified
    Added to the repo: 6.218 MiB
    
    processed 27 files, 6.217 MiB in 0:00
    snapshot ad49233b saved
    

    und noch einer

    root@frank-MS-7C37:~# restic -r rest:http://192.168.3.11:8000/ backup /home/frank/Bilder/
    enter password for repository: 
    repository 39436420 opened successfully, password is correct
    
    Files:         432 new,     0 changed,     0 unmodified
    Dirs:            2 new,     0 changed,     0 unmodified
    Added to the repo: 1.180 GiB
    
    processed 432 files, 1.237 GiB in 0:16
    snapshot ed35bfe7 saved
    

    snapshots

    root@frank-MS-7C37:~# restic -r rest:http://192.168.3.11:8000/ snapshots
    enter password for repository: 
    repository 39436420 opened successfully, password is correct
    ID        Time                 Host           Tags        Paths
    -------------------------------------------------------------------------------
    ad49233b  2020-05-10 09:48:10  frank-MS-7C37              /home/frank/Dokumente
    ed35bfe7  2020-05-10 09:48:38  frank-MS-7C37              /home/frank/Bilder
    -------------------------------------------------------------------------------
    2 snapshots
    

    Rest-Server

    Auf dem Rest-Server liegen die Daten in dem angegebenen Verzeichnis --path /home/rock64/backup

    root@rockpro64:/# ls -lha /home/rock64/backup/
    total 32K
    drwxr-xr-x   7 root   root   4.0K May 10 09:47 .
    drwxr-xr-x   5 rock64 rock64 4.0K May 10 09:43 ..
    -rw-------   1 root   root    155 May 10 09:47 config
    drwx------ 258 root   root   4.0K May 10 09:47 data
    drwx------   2 root   root   4.0K May 10 09:49 index
    drwx------   2 root   root   4.0K May 10 09:47 keys
    drwx------   2 root   root   4.0K May 10 09:49 locks
    drwx------   2 root   root   4.0K May 10 09:49 snapshots
    

    User Authentifizierung

    Zur Benutzerauthentifizierung benutzt der Rest-Server das Tool htpasswd, dazu muss folgendes installiert sein.

    apt install apache2-utils
    

    Danach kann man im Backup Pfad die .htaccess anlegen.

    root@rockpro64:/home/rock64/backup# htpasswd -B -c .htpasswd frank   
    New password: 
    Re-type new password: 
    Adding password for user frank
    

    Sieht dann im Verzeichnis so aus.

    root@rockpro64:/home/rock64/backup# ls -lha
    total 36K
    drwxr-xr-x   7 root   root   4.0K May 10 10:16 .
    drwxr-xr-x   5 rock64 rock64 4.0K May 10 09:43 ..
    -rw-r--r--   1 root   root     67 May 10 10:17 .htpasswd
    -rw-------   1 root   root    155 May 10 09:47 config
    drwx------ 258 root   root   4.0K May 10 09:47 data
    drwx------   2 root   root   4.0K May 10 09:49 index
    drwx------   2 root   root   4.0K May 10 09:47 keys
    drwx------   2 root   root   4.0K May 10 10:18 locks
    drwx------   2 root   root   4.0K May 10 09:49 snapshots
    

    Man kann jetzt, auf dieses Verzeichnis, nur noch drauf zugreifen wenn man sich mit USER und PASSWORD authentifiziert.

    Server Start

    root@rockpro64:/home/rock64/backup# rest-server --path /home/rock64/backup          
    Data directory: /home/rock64/backup
    Authentication enabled
    Private repositories disabled
    Starting server on :8000
    

    Server Zugriff

    root@frank-MS-7C37:~# restic -r rest:http://USER:PASSWORD@192.168.3.11:8000/ snapshots
    enter password for repository: 
    repository 39436420 opened successfully, password is correct
    ID        Time                 Host           Tags        Paths
    -------------------------------------------------------------------------------
    ad49233b  2020-05-10 09:48:10  frank-MS-7C37              /home/frank/Dokumente
    ed35bfe7  2020-05-10 09:48:38  frank-MS-7C37              /home/frank/Bilder
    -------------------------------------------------------------------------------
    2 snapshots
    
  • Und noch zwei Dinge, die interessant sind und noch ausprobiert werden müssen 😉

    The --append-only mode allows creation of new backups but prevents deletion and modification of existing backups. This can be useful when backing up systems that have a potential of being hacked.

    To prevent your users from accessing each others' repositories, you may use the --private-repos flag which grants access only when a subdirectory with the same name as the user is specified in the repository URL. For example, user "foo" using the repository URLs rest:https://foo:pass@host:8000/foo or rest:https://foo:pass@host:8000/foo/ would be granted access, but the same user using repository URLs rest:https://foo:pass@host:8000/ or rest:https://foo:pass@host:8000/foobar/ would be denied access.

  • --append-only

    Schützt Backups vor diesen fiesen Dinger, wie heißen die noch in der Windows Welt? Emotet oder so? 🙂

    Server starten

    root@rockpro64:/home/rock64/backup# rest-server --path /home/rock64/backup --append-only
    Data directory: /home/rock64/backup
    Authentication enabled
    Private repositories disabled
    Starting server on :8000
    

    Snapshots

    root@frank-MS-7C37:~# restic -r rest:http://USER:PASSWORD@192.168.3.11:8000/ snapshots
    enter password for repository: 
    repository 39436420 opened successfully, password is correct
    ID        Time                 Host           Tags        Paths
    -------------------------------------------------------------------------------
    ad49233b  2020-05-10 09:48:10  frank-MS-7C37              /home/frank/Dokumente
    ed35bfe7  2020-05-10 09:48:38  frank-MS-7C37              /home/frank/Bilder
    -------------------------------------------------------------------------------
    2 snapshots
    

    Snapshot entfernen

    root@frank-MS-7C37:~# restic -r rest:http://USER:PASSWORD@192.168.3.11:8000/ forget ad49233b
    enter password for repository: 
    repository 39436420 opened successfully, password is correct
    Remove(<snapshot/ad49233b1a>) returned error, retrying after 682.09481ms: blob not removed, server response: 403 Forbidden (403)
    Remove(<snapshot/ad49233b1a>) returned error, retrying after 1.019858552s: blob not removed, server response: 403 Forbidden (403)
    Remove(<snapshot/ad49233b1a>) returned error, retrying after 1.508077523s: blob not removed, server response: 403 Forbidden (403)
    Remove(<snapshot/ad49233b1a>) returned error, retrying after 2.060637198s: blob not removed, server response: 403 Forbidden (403)
    Remove(<snapshot/ad49233b1a>) returned error, retrying after 1.967534989s: blob not removed, server response: 403 Forbidden (403)
    Remove(<snapshot/ad49233b1a>) returned error, retrying after 5.102318508s: blob not removed, server response: 403 Forbidden (403)
    Remove(<snapshot/ad49233b1a>) returned error, retrying after 7.165967493s: blob not removed, server response: 403 Forbidden (403)
    Remove(<snapshot/ad49233b1a>) returned error, retrying after 6.624453285s: blob not removed, server response: 403 Forbidden (403)
    Remove(<snapshot/ad49233b1a>) returned error, retrying after 11.304339401s: blob not removed, server response: 403 Forbidden (403)
    

    Ok, funktioniert 🙂

  • IPv6

    root@frank-MS-7C37:~# restic -r rest:http://USER:PASSWORD@[2a02:908:1265:fbf0:xxxx:xxxx:xxxx:xxxx]:8000/ snapshots
    enter password for repository: 
    repository 39436420 opened successfully, password is correct
    ID        Time                 Host           Tags        Paths
    -------------------------------------------------------------------------------
    ad49233b  2020-05-10 09:48:10  frank-MS-7C37              /home/frank/Dokumente
    ed35bfe7  2020-05-10 09:48:38  frank-MS-7C37              /home/frank/Bilder
    -------------------------------------------------------------------------------
    2 snapshots
    
  • iptables

            #=========================
            # Rest-Server zur Firewall erlauben (IN)
            #=========================
            $IP4TABLES -A INPUT -p tcp --dport 8000 -j ACCEPT
            $IP6TABLES -A INPUT -p tcp --dport 8000 -j ACCEPT
    
  • Heute mal was Zeit gehabt zum Spielen. Rest-Server aufgesetzt, mittels Letsencrypt die TLS Verbindung eingerichtet und läuft alles. Bin gerade mal mein Home-Verzeichnis am hochladen. Evt. schreibe ich dazu einen separaten Beitrag.

  • Rest-Server in Version v0.10.0 released. Test folgt die Tage..

  • Dann mal eben ausprobiert. Auf meinem Server war die Version 0.9.7 selber, mit go, gebaut. Dann mache ich das auch mit der v0.10.0 so. Aber bevor ich anfange, wird die v0.9.7 gesichert.

    mv /usr/local/bin/rest-server /usr/local/bin/rest-server_0_9_7
    

    So erspare ich mir im Problemfall das selber bauen.

    Ok, dann die neue Version bauen.

    git clone https://github.com/restic/rest-server.git
    cd rest-server
    go run build.go
    

    Danach befindet sich im Verzeichnis die Binärdatei rest-server

    Die kopieren wir jetzt

    cp rest-server /usr/local/bin
    

    Danach kurzer Test

    # rest-server --version
    rest-server 0.10.0 (v0.10.0-6-g037fe06) compiled with go1.11.6 on linux/amd64
    

    Gut Version passt 🙂

    Dann ein Backup gestartet. Das sichert einen Teil meines Home-Verzeichnis

    Files:         153 new,   100 changed, 177857 unmodified
    Dirs:            0 new,     1 changed,     0 unmodified
    Added to the repo: 81.881 MiB
    
    processed 178110 files, 80.571 GiB in 0:28
    snapshot 607e0027 saved
    Applying Policy: keep the last 3 snapshots, 3 monthly snapshots
    keep 5 snapshots:
    ID        Time                 Host           Tags        Reasons           Paths
    ---------------------------------------------------------------------------------------
    fa97890e  2020-07-25 21:02:05  frank-XXX              monthly snapshot  /home/frank
    5b073bbb  2020-08-30 10:17:27  frank-XXX              monthly snapshot  /home/frank
    f7cf37ef  2020-09-06 15:13:03  frank-XXX              last snapshot     /home/frank
    0157462c  2020-09-13 13:32:12  frank-XXX              last snapshot     /home/frank
    607e0027  2020-09-14 08:09:34  frank-XXX              last snapshot     /home/frank
                                                              monthly snapshot
    ---------------------------------------------------------------------------------------
    5 snapshots
    
    remove 1 snapshots:
    ID        Time                 Host           Tags        Paths
    ---------------------------------------------------------------------
    3010b7cc  2020-09-06 11:39:27  frank-XXX             /home/frank
    ---------------------------------------------------------------------
    1 snapshots
    
    1 snapshots have been removed, running prune
    counting files in repo
    building new index for repo
    [1:34] 100.00%  17351 / 17351 packs
    

    So weit funktioniert das genau wie vorher. Im Changelog stand ja was von Subfoldern. Das betrifft mich nicht, weil ich für jeden User genau ein Verzeichnis habe.

    So mit alles Gut 🙂 Dann warte ich mal morgen ab, ob die täglichen Backups der Server rund laufen.

  • Vorstellung Restic UI Flask

    Restic UI Flask
    1
    0 Stimmen
    1 Beiträge
    163 Aufrufe
    Niemand hat geantwortet
  • Nextcloud - Update auf 28.0.2

    Nextcloud
    2
    0 Stimmen
    2 Beiträge
    146 Aufrufe
    FrankMF

    Für den, der sich alle Änderungen ansehen möchten -> https://github.com/nextcloud/server/releases

  • Wireguard - Client installieren

    Wireguard
    3
    0 Stimmen
    3 Beiträge
    563 Aufrufe
    FrankMF

    Ich kann dir nicht ganz folgen. Mein Wireguard Server ist eine VM im Netz. Mein Smartphone baut zu diesem eine Verbindung auf und ich habe mal eben nachgeschaut, was da so geht. Mein Smartphone ist aktuell im meinem WLan angemeldet.

    6e0016dc-7e11-41e1-bba2-e52a3f1348df-image.png

    iperf3 -s -B 10.10.1.1 ----------------------------------------------------------- Server listening on 5201 ----------------------------------------------------------- Accepted connection from 10.10.1.10, port 44246 [ 5] local 10.10.1.1 port 5201 connected to 10.10.1.10 port 44248 [ ID] Interval Transfer Bitrate [ 5] 0.00-1.00 sec 4.98 MBytes 41.7 Mbits/sec [ 5] 1.00-2.00 sec 5.52 MBytes 46.3 Mbits/sec [ 5] 2.00-3.00 sec 4.80 MBytes 40.3 Mbits/sec [ 5] 3.00-4.00 sec 4.17 MBytes 35.0 Mbits/sec [ 5] 4.00-5.00 sec 5.04 MBytes 42.3 Mbits/sec [ 5] 5.00-6.00 sec 5.43 MBytes 45.6 Mbits/sec [ 5] 6.00-7.00 sec 5.75 MBytes 48.3 Mbits/sec [ 5] 7.00-8.00 sec 5.70 MBytes 47.8 Mbits/sec [ 5] 8.00-9.00 sec 5.73 MBytes 48.1 Mbits/sec [ 5] 9.00-10.00 sec 5.65 MBytes 47.4 Mbits/sec [ 5] 10.00-10.04 sec 206 KBytes 46.5 Mbits/sec - - - - - - - - - - - - - - - - - - - - - - - - - [ ID] Interval Transfer Bitrate [ 5] 0.00-10.04 sec 53.0 MBytes 44.3 Mbits/sec receiver ----------------------------------------------------------- Server listening on 5201 ----------------------------------------------------------- Accepted connection from 10.10.1.10, port 44250 [ 5] local 10.10.1.1 port 5201 connected to 10.10.1.10 port 44252 [ ID] Interval Transfer Bitrate Retr Cwnd [ 5] 0.00-1.00 sec 4.80 MBytes 40.2 Mbits/sec 0 253 KBytes [ 5] 1.00-2.00 sec 14.7 MBytes 123 Mbits/sec 181 379 KBytes [ 5] 2.00-3.00 sec 9.68 MBytes 81.2 Mbits/sec 58 294 KBytes [ 5] 3.00-4.00 sec 8.88 MBytes 74.5 Mbits/sec 1 227 KBytes [ 5] 4.00-5.00 sec 7.76 MBytes 65.1 Mbits/sec 0 245 KBytes [ 5] 5.00-6.00 sec 8.88 MBytes 74.5 Mbits/sec 0 266 KBytes [ 5] 6.00-7.00 sec 9.81 MBytes 82.3 Mbits/sec 0 289 KBytes [ 5] 7.00-8.00 sec 7.82 MBytes 65.6 Mbits/sec 35 235 KBytes [ 5] 8.00-9.00 sec 5.59 MBytes 46.9 Mbits/sec 4 186 KBytes [ 5] 9.00-10.00 sec 6.64 MBytes 55.7 Mbits/sec 0 207 KBytes - - - - - - - - - - - - - - - - - - - - - - - - - [ ID] Interval Transfer Bitrate Retr [ 5] 0.00-10.04 sec 84.6 MBytes 70.6 Mbits/sec 279 sender ----------------------------------------------------------- Server listening on 5201 ----------------------------------------------------------- ^Ciperf3: interrupt - the server has terminated

    Im zweiten Teil ist der Wireguard Server der Sender.

    Bis jetzt hatte ich eigentlich nie Probleme, auch nicht unterwegs. Aber, ich gehe davon aus, das ich dich nicht 100% verstanden habe 😉

  • Restic - forget --keep-last 3 --prune

    Restic
    2
    0 Stimmen
    2 Beiträge
    598 Aufrufe
    FrankMF

    Ich habe mich damit noch ein wenig beschäftigt, die letzten drei zu behalten, ist nicht so optimal. Da es viele Optionen bei dem Befehl gibt, hier ein Ausschnitt

    Flags: -l, --keep-last n keep the last n snapshots -H, --keep-hourly n keep the last n hourly snapshots -d, --keep-daily n keep the last n daily snapshots -w, --keep-weekly n keep the last n weekly snapshots -m, --keep-monthly n keep the last n monthly snapshots -y, --keep-yearly n keep the last n yearly snapshots

    habe ich das ein wenig so angepasst, das ich denke es passt für mich.

    restic --password-file /root/passwd -r /media/NAS_neu/Restic/Home/ forget --keep-last 3 --keep-monthly 3 --prune

    Damit behalte ich auch die jeweils eines pro Monat. Und die letzten drei. Das sieht dann so aus.

    root@debian:~# ./backup2.sh repository 2f3f6147 opened successfully, password is correct Files: 38 new, 100 changed, 13268 unmodified Dirs: 0 new, 1 changed, 0 unmodified Added to the repo: 10.166 GiB processed 13406 files, 50.324 GiB in 3:24 snapshot 849f614c saved repository 2f3f6147 opened successfully, password is correct Applying Policy: keep the last 3 snapshots, 3 monthly snapshots snapshots for (host [debian], paths [/home/frank]): keep 5 snapshots: ID Time Host Tags Reasons Paths ------------------------------------------------------------------------------------ a7251cfd 2019-11-28 17:00:01 debian monthly snapshot /home/frank 283d4027 2019-12-31 17:00:01 debian monthly snapshot /home/frank ae2b96ec 2020-01-01 21:47:46 debian last snapshot /home/frank 079e00a6 2020-01-02 17:00:01 debian last snapshot /home/frank 849f614c 2020-01-03 21:08:45 debian last snapshot /home/frank monthly snapshot ------------------------------------------------------------------------------------ 5 snapshots remove 26 snapshots: ID Time Host Tags Paths ------------------------------------------------------------------ 896f16c2 2019-11-07 22:23:40 debian /home/frank b21bcf6d 2019-11-11 17:00:01 debian /home/frank f89248fb 2019-11-12 17:00:01 debian /home/frank 123ab546 2019-11-13 17:00:01 debian /home/frank b82d87d0 2019-11-18 17:00:01 debian /home/frank 040b0ab7 2019-11-19 17:00:01 debian /home/frank 7221d8ef 2019-11-20 17:00:01 debian /home/frank 84132a25 2019-11-21 17:00:01 debian /home/frank b558a52c 2019-11-25 17:00:01 debian /home/frank e5cc0c3e 2019-12-02 17:00:01 debian /home/frank 22423fa5 2019-12-03 17:00:01 debian /home/frank 39df1ab9 2019-12-04 17:00:01 debian /home/frank 98843457 2019-12-05 17:00:01 debian /home/frank b0cdd4b6 2019-12-09 17:00:01 debian /home/frank 828414f9 2019-12-10 17:00:01 debian /home/frank e34a27c3 2019-12-11 17:00:01 debian /home/frank 6e488c3b 2019-12-12 17:00:01 debian /home/frank 17898403 2019-12-16 17:00:01 debian /home/frank 1973305a 2019-12-17 17:00:01 debian /home/frank 9553bedd 2019-12-18 17:00:01 debian /home/frank fedf749d 2019-12-19 17:00:01 debian /home/frank 8e7cb876 2019-12-23 17:00:01 debian /home/frank 0bd0d102 2019-12-25 17:00:01 debian /home/frank 13d348b0 2019-12-26 17:00:01 debian /home/frank c7d960aa 2019-12-30 17:00:01 debian /home/frank f6ea9118 2020-01-01 17:00:01 debian /home/frank ------------------------------------------------------------------ 26 snapshots 26 snapshots have been removed, running prune counting files in repo building new index for repo [0:35] 100.00% 7806 / 7806 packs repository contains 7806 packs (46537 blobs) with 41.110 GiB processed 46537 blobs: 0 duplicate blobs, 0 B duplicate load all snapshots find data that is still in use for 5 snapshots [0:01] 100.00% 5 / 5 snapshots found 32654 of 46537 data blobs still in use, removing 13883 blobs will remove 0 invalid files will delete 715 packs and rewrite 752 packs, this frees 5.027 GiB [2:28] 100.00% 752 / 752 packs rewritten counting files in repo [0:01] 100.00% 6571 / 6571 packs finding old index files saved new indexes as [d137b425 f7caee99 a6e9711a] remove 35 old index files [1:13] 100.00% 1467 / 1467 packs deleted done using temporary cache in /tmp/restic-check-cache-916655151 repository 2f3f6147 opened successfully, password is correct created new cache in /tmp/restic-check-cache-916655151 create exclusive lock for repository load indexes check all packs check snapshots, trees and blobs read all data [7:47] 100.00% 6571 / 6571 items duration: 7:47 no errors were found root@debian:~#

    Am Ende seht ihr noch, wie Restic alle Files testet. Mein Script sieht jetzt so aus.

    #!/bin/bash # Script um mit Restic Daten automatisiert zu sichern! # Dient zum Sichern der Homepartition auf dem ROCKPro64 NAS! # Was soll gesichert werden? backup_pfad=/home/frank # Programm Start restic --password-file /root/passwd -r /media/NAS_neu/Restic/Home/ backup $backup_pfad --exclude-file=excludes.txt restic --password-file /root/passwd -r /media/NAS_neu/Restic/Home/ forget --keep-last 3 --keep-monthly 3 --prune # Testen restic --password-file /root/passwd -r /media/NAS_neu/Restic/Home/ check --read-data

    Das dann schön mit einem Cronjob laufen lassen und die Datensicherung ist erledigt 😉

  • Linux Befehle - ls & tail

    Linux
    1
    0 Stimmen
    1 Beiträge
    377 Aufrufe
    Niemand hat geantwortet
  • Hetzner - Backupspace - Borgbackup

    Linux
    4
    0 Stimmen
    4 Beiträge
    920 Aufrufe
    FrankMF

    Ok, da gibt es doch wohl noch ein kleines Problem 🙂

    Hetzner hat die Dienste migriert und ich war der Meinung, der Borg funktioniert nicht mehr. Ok, das hat er auch gemacht, aber der Grund wurde mir dann vom Support mitgeteilt, Der Backup Space ist voll. Huch, was läuft denn da falsch!?

    Ich konnte den Backup Space noch per SFTP erreichen, Borg gab aber immer eine merkwürdige Fehlermeldung heraus.
    Also aufpassen, wenn ihr mal Probleme habt, schaut mal nach ob ihr noch genug Platz habt 😉

    Und jetzt muss ich das Script mal ein wenig überarbeiten, irgendwas läuft da nicht so, wie ich mir das vorstelle.

  • pdo Abfrage funktioniert nicht

    Linux
    2
    0 Stimmen
    2 Beiträge
    515 Aufrufe
    FrankMF

    Wichtig ist natürlich auch, das folgendes php Paket installiert ist!

    sudo apt install php7.0-mysql

    Je nachdem welche PHP Version installiert ist, muss der Befehl angepasst werden. Mit

    php -v

    könnt ihr nachschauen welche Version installiert ist.

  • Liste von Linuxbefehlen

    Angeheftet Linux
    3
    0 Stimmen
    3 Beiträge
    678 Aufrufe
    FrankMF
    systemd Anzeige der geladenen Dienste root@host:/etc/systemd/system# systemctl --type=service UNIT LOAD ACTIVE SUB DESCRIPTION atd.service loaded active running Deferred execution scheduler blk-availability.service loaded active exited Availability of block devices cloud-config.service loaded active exited Apply the settings specified in cloud-config cloud-final.service loaded active exited Execute cloud user/final scripts cloud-init-local.service loaded active exited Initial cloud-init job (pre-networking) cloud-init.service loaded active exited Initial cloud-init job (metadata service crawler) console-setup.service loaded active exited Set console font and keymap cron.service loaded active running Regular background program processing daemon crowdsec-firewall-bouncer.service loaded active running The firewall bouncer for CrowdSec crowdsec.service loaded active running Crowdsec agent dbus.service loaded active running D-Bus System Message Bus getty@tty1.service loaded active running Getty on tty1 ifupdown-pre.service loaded active exited Helper to synchronize boot up for ifupdown keyboard-setup.service loaded active exited Set the console keyboard layout kmod-static-nodes.service loaded active exited Create List of Static Device Nodes lvm2-monitor.service loaded active exited Monitoring of LVM2 mirrors, snapshots etc. using dmeventd or progress polling mariadb.service loaded active running MariaDB 10.11.3 database server networking.service loaded active exited Raise network interfaces nginx.service loaded active running A high performance web server and a reverse proxy server qemu-guest-agent.service loaded active running QEMU Guest Agent resolvconf.service loaded active exited Nameserver information manager semaphore.service loaded active running Ansible Semaphore serial-getty@ttyS0.service loaded active running Serial Getty on ttyS0 ssh.service loaded active running OpenBSD Secure Shell server systemd-binfmt.service loaded active exited Set Up Additional Binary Formats systemd-fsck@dev-disk-by\x2duuid-1E22\x2dDC00.service loaded active exited File System Check on /dev/disk/by-uuid/1E22-DC00 systemd-journal-flush.service loaded active exited Flush Journal to Persistent Storage systemd-journald.service loaded active running Journal Service systemd-logind.service loaded active running User Login Management systemd-modules-load.service loaded active exited Load Kernel Modules systemd-random-seed.service loaded active exited Load/Save Random Seed systemd-remount-fs.service loaded active exited Remount Root and Kernel File Systems systemd-sysctl.service loaded active exited Apply Kernel Variables systemd-sysusers.service loaded active exited Create System Users systemd-timesyncd.service loaded active running Network Time Synchronization systemd-tmpfiles-setup-dev.service loaded active exited Create Static Device Nodes in /dev systemd-tmpfiles-setup.service loaded active exited Create Volatile Files and Directories systemd-udev-trigger.service loaded active exited Coldplug All udev Devices systemd-udevd.service loaded active running Rule-based Manager for Device Events and Files systemd-update-utmp.service loaded active exited Record System Boot/Shutdown in UTMP systemd-user-sessions.service loaded active exited Permit User Sessions ufw.service loaded active exited Uncomplicated firewall user-runtime-dir@0.service loaded active exited User Runtime Directory /run/user/0 user@0.service loaded active running User Manager for UID 0 LOAD = Reflects whether the unit definition was properly loaded. ACTIVE = The high-level unit activation state, i.e. generalization of SUB. SUB = The low-level unit activation state, values depend on unit type. 44 loaded units listed. Pass --all to see loaded but inactive units, too. To show all installed unit files use 'systemctl list-unit-files'.