Hauptmenü

sript backup.sh auslösen

Begonnen von choetzu, 23 März 2017, 20:57:10

Vorheriges Thema - Nächstes Thema

Frank_Huber

Leon,

ich war anfangs auch skeptisch. bin zwar unter Linux eher der Amateur, aber vom Grunde her auch ITler. :-)

Aber das Raspbian Tool tut seinen Dienst! hab ich schon mehrfach getestet und zum neu aufsetzen meiner 4 Instanzen hab ich auch die Karten geklont.

Zitat von https://www.raspberrypi.org/blog/another-update-raspbian/:

ZitatSD card copier

One query which comes up a lot on the forums is about the best way to back up your Pi. People also want to know how to migrate their Raspbian install to a new SD card which is larger or smaller than the one they are using at the moment. This has been difficult with the command-line tools that we've recommended in the past, so there is now a new application to help with this, and you'll find it in the menu under 'Accessories'.

sdcc

The SD Card Copier application will copy Raspbian from one card to another – that's pretty much all it does – but there are several useful things that you can do as a result. To use it, you will need a USB SD card writer.

To take a common example: what if you want to back up your existing Raspbian installation? Put a blank SD card in your USB card writer and plug it into your Pi, and then launch SD Card Copier. In the 'Copy From Device' box, select "Internal SD Card", and then select the USB card writer in the 'Copy To Device' box (where it will probably be the only device listed). Press 'Start', watch the messages on the screen and wait – in ten or fifteen minutes, you should have a clone of your current installation on the new SD card. You can test it by putting the newly-copied card into the Pi's SD card slot and booting it; it should boot and look exactly the same as your original installation, with all your data and applications intact.

You can run directly from the backup, but if you want to recover your original card from your backup, simply reverse the process – boot your Pi from the backup card, put the card to which you want to restore into the SD card writer, and repeat the process above.

The program does not restrict you to only copying to a card the same size as the source; you can copy to a larger card if you are running out of space on your existing one, or even to a smaller card (as long as it has enough space to store all your files – the program will warn you if there isn't enough space). It has been designed to work with Raspbian and NOOBS images; it may work with other OSes or custom card formats, but this can't be guaranteed.

The only restriction is that you cannot write to the internal SD card reader, as that would overwrite the OS you are actually running, which would cause bad things to happen.

Please also bear in mind that everything on the destination card will be overwritten by this program, so do make sure you've got nothing you want to keep on the destination card before you hit Start!

Wernieman

Was beim RasPi meistens funktioniert, da durch wenig ram sehr wenig gecacht wird.

Nur meine Erfahrung als Administrator: Genau wenn man es braucht, hat man den Fall: Es funzt nicht ....

Nicht ohne Grund gibt es für BarMetal-Recovery (sehr) Teure Produkte im Backup Bereich ....

Meine Empfehlung (privat):
Alle Daten für eine Neuinstallation bereit haben (/etc, fhem etc) und im Notfall eine Neuinstallation und Config aus dem Backup.
Wenn man eine Installationsanleitung sich gemacht hat (Ich weiß, vergisst man meistens), hat man auch schon ein sehr gutes Backup ;o)

P.S: Mein Backup /etc und fhem.cfg hat mir privta schon "den Arsch" gerettet ... die Familie kann böse sein, wenn diverse "Dienste" nicht gehen ...
- Bitte um Input für Output
- When there is a Shell, there is a Way
- Wann war Dein letztes Backup?

Wie man Fragen stellt: https://tty1.net/smart-questions_de.html

Frank_Huber

Der SD Klon sollte auch nicht das einzige Backup sein.
Das zuverlässigste und sicherste ist zweifelsfrei wie von Leon geschrieben das herunterfahren, SD Karte raus und manuell klonen.
Dabei ist aber das System ne "Weile" offline. Das will man sicherlich nicht jede Woche machen.

meine "Strategie"
- FHEM Backup auf Fileserver jede Nacht.
- einmal wöchentlich der "online SD Klon"
- unregelmäßig so alle 3 bis 6 Monate den offline Klon.

Und wenn nach knapp 2 Jahren das System streikt kann man ja auch überlegen ob man nicht auf aktuellem Raspbian wieder aufsetzt und nur das FHEM Backup zurückholt.
Eine gute Doku der installierten Debian Pakete und FHEM Module ist dabei unersetzlich.

Wernieman

P.S. und Backup bitte Versionieren ... also mehr als eine "Version"
- Bitte um Input für Output
- When there is a Shell, there is a Way
- Wann war Dein letztes Backup?

Wie man Fragen stellt: https://tty1.net/smart-questions_de.html

choetzu

Guten Morgen,

ich komme auf oben stehendes Thema zurück. Ursprünglich hat das backup.sh geklappt. Nachdem ich aber versucht habe, das selbe für die ganze SD Karte zu machen, hat es mir irgendwie etwas geändert, was ich nicht wollte. Nun kommt beim täglich backup von FHEM folgende Meldung:

10.0.1.18 erreichbar
/Q/backup bereits vorhanden
/Q/backup leer, Mounten starten
mountComplete: //10.0.1.18/FHEM /Q/backup cifs username=pi,password=xx,iocharset=utf8,sec=ntlm 0 0
mountComplete: //10.0.1.18/FHEM /Q/backup cifs username=pi,password=xx,iocharset=utf8,sec=ntlm 0 0
mountComplete: //10.0.1.18/FHEM /Q/backup cifs username=pi,password=xx,iocharset=utf8,sec=ntlm 0 0
mountComplete: //10.0.1.18/FHEM /Q/backup cifs username=pi,password=xx,iocharset=utf8,sec=ntlm 0 0
mountComplete: //10.0.1.18/FHEM /Q/backup cifs username=pi,password=xx,iocharset=utf8,sec=ntlm 0 0
mountComplete: //10.0.1.18/FHEM /Q/backup cifs username=pi,password=xx,iocharset=utf8,sec=ntlm 0 0
/etc/fstab: Eintrag bereits vorhanden: //10.0.1.18/FHEM /Q/backup cifs username=pi,password=xx,iocharset=utf8,sec=ntlm 0 0
Mounts werden aktualisiert
mount error(22): Invalid argument
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
Mounten hat anscheinend nicht geklappt, skip.


Mount error (22). Wenn ich das Google kommt vieles, aber alles irgendwie chinesisch für mich.. Was meint ihr?

Lg c
Raspi3, EnOcean, Zwave, Homematic

Wernieman

Zitat/etc/fstab: Eintrag bereits vorhanden: //10.0.1.18/FHEM /Q/backup cifs username=pi,password=xx,iocharset=utf8,sec=ntlm 0 0
Bearbeitest Du Deine fstab??
- Bitte um Input für Output
- When there is a Shell, there is a Way
- Wann war Dein letztes Backup?

Wie man Fragen stellt: https://tty1.net/smart-questions_de.html

choetzu

hallo wernieman, danke.

was meinst du mit bearbeiten? geändert? Ja, habe ich gemacht mit "sudo nano etc/fstab  und dann die entsprechende Zeile wieder rausgelöscht, nachdem ich sie manuell reingemacht habe..

Hmm, hab ich (wieder) Scheiss gemacht? ;)

lg c
Raspi3, EnOcean, Zwave, Homematic

Wernieman

was ist denn genau gemountet?
mount
- Bitte um Input für Output
- When there is a Shell, there is a Way
- Wann war Dein letztes Backup?

Wie man Fragen stellt: https://tty1.net/smart-questions_de.html

Matze66

Problem hatte ich auch. Du musst in der fstab folgendes ändern:

//192.168.100.20/backup /Q/backup cifs username=xxxxx,password=xxxxx,iocharset=utf8,sec=ntlm 0 0

in
//192.168.100.20/backup /Q/backup cifs username=xxxxx,password=xxxxx,iocharset=utf8,sec=ntlmssp 0 0

choetzu

Zitat von: Wernieman am 24 April 2018, 13:22:22
was ist denn genau gemountet?
mount

ich mounte mein NAS... Es hat vor meinen Manipulationen wunderbar geklappt..

@Matze66: Das probier ich heute Abend aus. Danke.
Raspi3, EnOcean, Zwave, Homematic

Wernieman

Oder einfach den "eigentlich) nicht nötigen Parameter "sec=ntlmssp"  rausnehmen
- Bitte um Input für Output
- When there is a Shell, there is a Way
- Wann war Dein letztes Backup?

Wie man Fragen stellt: https://tty1.net/smart-questions_de.html

choetzu

Guten Morgen

Das backup hat geklappt, aber es gibt immer noch die Fehlermeldung . Hmm, woher kommt das wohl?

/etc/fstab: Eintrag bereits vorhanden: //10.0.1.18/FHEM /Q/backup cifs username=pi,password=xx,iocharset=utf8
Mounts werden aktualisiert
mount error(22): Invalid argument
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
/Q/backup//10.0.1.34 existiert bereits
180425_010000_fhem_backup.tar.gz (35 MB) wird in den Backupordner verschoben
11 Backups vorhanden - nur 10 aktuelle Backups werden vorgehalten - 1 Backups werden gelöscht
Mount wieder unmounten
Raspi3, EnOcean, Zwave, Homematic

Wernieman

Guck mal mit
mount
ob an dem Mountpoint schon etwas gemountet ist ...
- Bitte um Input für Output
- When there is a Shell, there is a Way
- Wann war Dein letztes Backup?

Wie man Fragen stellt: https://tty1.net/smart-questions_de.html

choetzu

Hallo Wernieman
danke für deine Geduld.. ;)

Wenn ich mount eingebe kommt eine lange liste, jedoch nirgends etwas von /Q/backup oder 10.0.1.18... Brauchst du die ganze Liste?
Raspi3, EnOcean, Zwave, Homematic

Wernieman

mount | grep Q

Kannst Du nicht sinvollere Namen als "Q" verwenden?

Unix braucht keine Laufwerksbuchstaben, da sollte man dann lieber sinvolle Mountpoint-Namen verwenden.
- Bitte um Input für Output
- When there is a Shell, there is a Way
- Wann war Dein letztes Backup?

Wie man Fragen stellt: https://tty1.net/smart-questions_de.html