Host:matomat.fritz.box: Unterschied zwischen den Versionen

Aus k4cg.org
 
Keine Bearbeitungszusammenfassung
 
(14 dazwischenliegende Versionen von 2 Benutzern werden nicht angezeigt)
Zeile 1: Zeile 1:
#WEITERLEITUNG [[Hosts:matomat.intern.k4cg.org]]
{{Hostbox
| ipv4 = 192.168.178.27
| network = 255.255.255.0
| gateway = 192.168.178.1
| DNS = 192.168.178.1
| OS = Debian (9.8)
| location = K4CG
| dns-search = k4cg.org
}}
[[Kategorie:Dokumentationen]]
[[Kategorie:Hosts]]
 
=== Users ===
admin-user:
* penis
* gpunktschmitz
* noqqe
 
=== Setup matomat-service ===
 
Im Homeverzeichnis des systemusers <code>maas</code> befindet sich der matomat backend Code.
 
Dort liegt auch die User Datenbank. Details siehe [[Projekt:Matomat-Service]]
 
=== Setup heiko ===
 
Im Homeverzeichnis des systemusers <code>heiko</code> befindet sich der matomat frontend Code.
 
Details Für Installation/Backup/Upgrade siehe [[Projekt:Heiko]]
 
=== Backup von Matomat ===
 
Backup läuft jede Nacht um 02:00 Uhr und wird auf [[Host:qnap.intern.k4cg.org]] gesynct
 
Es wird unter <code>/share/BACKUP/matomat</code> gespeichert
 
Backup funktioniert so
 
<pre>
RESTIC_PASSWORD=xxx
RESTIC_REPOSITORY=sftp:admin@192.168.178.8:/share/BACKUP/matomat/
0 2 * * * restic backup /home/maas /home/heiko /var/matomat
</pre>
 
=== Restore ===
 
<pre>
# restic snapshots
ID        Date                Host        Tags        Directory
----------------------------------------------------------------------
54cc2d0c  2019-03-28 13:44:18  matomat                /home/heiko
                                                      /home/maas
                                                      /var/matomat
71ba2ea6  2019-03-28 14:12:41  matomat                /home/heiko
                                                      /home/maas
                                                      /var/matomat
</pre>
 
Alles aus einer ID restoren:
 
restic restore 54cc2d0c --target /tmp/foo
restoring <Snapshot 54cc2d0c of [/home/heiko /home/maas /var/matomat] at 2019-03-28 13:44:18.454347385 +0100 CET by root@matomat> to /tmp/foo
 
Nur ein Spezielles file:
 
<pre>
# restic restore 54cc2d0c --target /tmp/foo --include config.yml
# find /tmp/foo/
/tmp/foo/
/tmp/foo/maas
/tmp/foo/maas/config.yml
/tmp/foo/heiko
/tmp/foo/heiko/config.yml
/tmp/foo/heiko/heiko
/tmp/foo/heiko/heiko/config.yml
 
anderes beispiel
 
# restic restore --target /tmp/foo latest --include matomat.db
# find /tmp/foo/
/tmp/foo/
/tmp/foo/matomat
/tmp/foo/matomat/matomat.db
 
</pre>
 
Nur 1 Dirrectory von alle inkludierten:
 
restic restore 54cc2d0c --target /tmp/foo --path /var/matomat

Aktuelle Version vom 21. Oktober 2019, 22:11 Uhr

Host:matomat.fritz.box
IPv4 192.168.178.27
Network 255.255.255.0
Gateway 192.168.178.1
DNS 192.168.178.1
OS Debian (9.8)
Location K4CG

Users

admin-user:

  • penis
  • gpunktschmitz
  • noqqe

Setup matomat-service

Im Homeverzeichnis des systemusers maas befindet sich der matomat backend Code.

Dort liegt auch die User Datenbank. Details siehe Projekt:Matomat-Service

Setup heiko

Im Homeverzeichnis des systemusers heiko befindet sich der matomat frontend Code.

Details Für Installation/Backup/Upgrade siehe Projekt:Heiko

Backup von Matomat

Backup läuft jede Nacht um 02:00 Uhr und wird auf Host:qnap.intern.k4cg.org gesynct

Es wird unter /share/BACKUP/matomat gespeichert

Backup funktioniert so

RESTIC_PASSWORD=xxx
RESTIC_REPOSITORY=sftp:admin@192.168.178.8:/share/BACKUP/matomat/
0 2 * * * restic backup /home/maas /home/heiko /var/matomat

Restore

# restic snapshots
ID        Date                 Host        Tags        Directory
----------------------------------------------------------------------
54cc2d0c  2019-03-28 13:44:18  matomat                 /home/heiko
                                                       /home/maas
                                                       /var/matomat
71ba2ea6  2019-03-28 14:12:41  matomat                 /home/heiko
                                                       /home/maas
                                                       /var/matomat

Alles aus einer ID restoren:

restic restore 54cc2d0c --target /tmp/foo
restoring <Snapshot 54cc2d0c of [/home/heiko /home/maas /var/matomat] at 2019-03-28 13:44:18.454347385 +0100 CET by root@matomat> to /tmp/foo

Nur ein Spezielles file:

# restic restore 54cc2d0c --target /tmp/foo --include config.yml
# find /tmp/foo/
/tmp/foo/
/tmp/foo/maas
/tmp/foo/maas/config.yml
/tmp/foo/heiko
/tmp/foo/heiko/config.yml
/tmp/foo/heiko/heiko
/tmp/foo/heiko/heiko/config.yml

anderes beispiel

# restic restore --target /tmp/foo latest --include matomat.db
# find /tmp/foo/
/tmp/foo/
/tmp/foo/matomat
/tmp/foo/matomat/matomat.db

Nur 1 Dirrectory von alle inkludierten:

restic restore 54cc2d0c --target /tmp/foo --path /var/matomat