staging.inyokaproject.org

tar & split

Status: Gelöst | Ubuntu-Version: Kubuntu 13.04 (Raring Ringtail)
Antworten |

lombas

Anmeldungsdatum:
9. April 2008

Beiträge: 43

Hallo alle zusammen, ich versuche meine Daten durch tar zu sichern sowie hier: http://stackoverflow.com/questions/1120095/split-files-using-tar-gz-zip-or-bzip2 angezeigt wird. Ich wollte ein Script erstellen wo ich die Daten einpacke und dann durch split sie splitten, ich habe das probiert:

1
tar cvpzf /home/user/Dokumente/. | split -b 1G daten_split.tar.

dann

1
sudo tar cvpzf iso.tar "/home/user/Dokumente/." | split -b 1G iso.tar split-archiv.tar.

es funktioniert leider nicht.

per Terminal funktioniert tar cvpzf iso.tar /home/user/Dokumente/. und danach split -b 1G iso.tar split-archiv.tar.. Kann jemand mir sagen was soll ich ändern? oder besser mit welcher Programme könnte ich eine Sicherung per Script schaffen, die auch schnell, flexibel und sicher genug ist.

Danke in voraus

Danke in voraus

Moderiert von redknight:

Ins Backupforum verschoben.

redknight Team-Icon

Moderator & Supporter
Avatar von redknight

Anmeldungsdatum:
30. Oktober 2008

Beiträge: 21863

tar ist kein geeignetes Tool zum sichern, wie Stefan hier in Regel 7 ausführt. Das Wiki hat einige Anregungen, wie man das sinnvoll durechführt.

MoHo1

Anmeldungsdatum:
3. Januar 2010

Beiträge: 196

AFAIK schreibt tar auch die Dateinamen auf die Standardausgabe, um also nur die Daten an Split zu übergeben müsstest du folgendes schreiben:

tar cpzf - /home/user/Dokumente/. | split -b 1G - daten_split.tar.gz.

Ich habe hier auch noch die Endung für eine ge-gezippte Datei hinzugefügt.

Im übrigen bietet bzip2 i.d.R. eine bessere Kompressionsrate und kann im Falle einer Beschädigung auch teilweise wiederhergestellt werden. Wenn dein Rechner also genügend Rechenleistung hat, solltest du dieses bevorzugen.

frostschutz

Avatar von frostschutz

Anmeldungsdatum:
18. November 2010

Beiträge: 7795

Also f - ist Unsinn, wenn tar auf stdin/out werkeln soll, bleibt der f Parameter einfach weg und gut.

Mit dar gibt es eine Alternative die tar sehr nahe kommt, aber von sich aus gesplittete Archive, selektive Kompression, und Direktzugriff auf Dateien innerhalb des Archivs ermöglicht.

Ob das jetzt geeignet ist oder nicht, muß jeder mit sich selbst ausmachen. Ich benutze es sehr gerne, habe aber auch meine ganz eigenen Scripte dafür. Andere Lösungen sind da sicherlich komfortabler.

MoHo1

Anmeldungsdatum:
3. Januar 2010

Beiträge: 196

Zumindest unter FreeBSD mach tar bei fehlender Angabe von -f Probleme. Auch wenn das Linux-tar dies vielleicht nicht macht ist mit -f - sicherer. Aber du hast natürlich recht, dass dies nicht unbedingt nötig ist.

lombas

(Themenstarter)

Anmeldungsdatum:
9. April 2008

Beiträge: 43

danke an alle für die Antworten und Tipps, ich werde die Beispiele ausprobieren und den Link von redknight durchlesen, und melde mich wieder, danke.

lombas

(Themenstarter)

Anmeldungsdatum:
9. April 2008

Beiträge: 43

ich habe die Anleitungen von dar gelesen, die Möglichkeiten sind unglaublich, ich habe auch ein paar Seiten mit Scripts http://dar.linux.free.fr/doc/samples/ und http://openlife.cc/blogs/2011/july/backup-scripts-fro-dar die ich noch anpassen und testen werde. Die letzte und für mich die wichtigste Frage wäre: kann man eine Sicherung starten (mit dar) beim laufende Betrieb? wenn so wäre hätte ich meine Wunderwaffe 👍 gefunden.

Danke wieder im voraus.

frostschutz

Avatar von frostschutz

Anmeldungsdatum:
18. November 2010

Beiträge: 7795

lombas schrieb:

Die letzte und für mich die wichtigste Frage wäre: kann man eine Sicherung starten (mit dar) beim laufende Betrieb? wenn so wäre hätte ich meine Wunderwaffe 👍 gefunden.

Ja, mit den üblichen Einschränkungen.

Es kommt eben darauf an, was da so genau läuft. Eine Datenbank die ständig geschrieben wird bekommst du mit dar nicht gesichert, genausowenig wie mit tar. Nicht ohne Snapshot jedenfalls... Aber Datenbanken haben normalerweise ihre eigenen Backup/Export/Import-Mechanismen.

lombas

(Themenstarter)

Anmeldungsdatum:
9. April 2008

Beiträge: 43

danke für die Antworten und die Tipps. Ich habe ein paar kleine Scripts getestet und funktionieren wunderbar, ich hoffe kann ich alles richtig machen und für die Zukunft "gesichert" sein kann.

nach ich die Script finde/erstelle und getestet habe und wenn keine Probleme auftauchen, werde ich dieses Thema als gelöst markieren, danke zur Zeit für die Hilfe und bist zum Wochenende.

lombas

(Themenstarter)

Anmeldungsdatum:
9. April 2008

Beiträge: 43

Hallo alle zusammen, ich habe dar ausprobiert, es ist wirklich fantastisch, wenn ich eine Sicherung meiner Daten ausüben möchte, ich habe es weiter getestet und wollte eine komplette Sicherung der Festplatte, ohne erfolgt, hier die Fehlermeldungen:

Error while saving /sys/devices/pci0000:00/0000:00:1c.4/0000:04:00.0/0000:05:01.4/reset: Cannot open file : Permission denied
Error while saving /sys/devices/pci0000:00/0000:00:1c.4/0000:04:00.0/0000:05:01.4/remove: Cannot open file : Permission denied
Error while saving /sys/devices/pci0000:00/0000:00:1c.4/0000:04:00.0/0000:05:01.4/rescan: Cannot open file : Permission denied
Error while saving /sys/devices/pci0000:00/0000:00:1c.4/0000:04:00.0/0000:05:01.4/resource0: Error while reading from file: Input/output error
Error while saving /sys/devices/pci0000:00/0000:00:1c.4/0000:04:00.0/remove: Cannot open file : Permission denied
Error while saving /sys/devices/pci0000:00/0000:00:1c.4/0000:04:00.0/rescan: Cannot open file : Permission denied
Error while saving /sys/devices/pci0000:00/0000:00:1c.4/0000:04:00.0/pci_bus/0000:05/power/autosuspend_delay_ms: Error while reading from file: Input/output error
Error while saving /sys/devices/pci0000:00/0000:00:1c.4/0000:04:00.0/pci_bus/0000:05/rescan: Cannot open file : Permission denied
Error while saving /sys/devices/pci0000:00/0000:00:1c.4/remove: Cannot open file : Permission denied
Error while saving /sys/devices/pci0000:00/0000:00:1c.4/rescan: Cannot open file : Permission denied
Error while saving /sys/devices/pci0000:00/0000:00:1c.4/pci_bus/0000:04/power/autosuspend_delay_ms: Error while reading from file: Input/output error
Error while saving /sys/devices/pci0000:00/0000:00:1c.4/pci_bus/0000:04/rescan: Cannot open file : Permission denied
Error while saving /sys/devices/pci0000:00/0000:00:1c.6/power/autosuspend_delay_ms: Error while reading from file: Input/output error
Error while saving /sys/devices/pci0000:00/0000:00:1c.6/reset: Cannot open file : Permission denied
Error while saving /sys/devices/pci0000:00/0000:00:1c.6/0000:06:00.0/net/wlan0/power/autosuspend_delay_ms: Error while reading from file: Input/output error
Error while saving /sys/devices/pci0000:00/0000:00:1c.6/0000:06:00.0/net/wlan0/speed: Error while reading from file: Invalid argument
Error while saving /sys/devices/pci0000:00/0000:00:1c.6/0000:06:00.0/net/wlan0/dormant: Error while reading from file: Invalid argument
Error while saving /sys/devices/pci0000:00/0000:00:1c.6/0000:06:00.0/net/wlan0/duplex: Error while reading from file: Invalid argument
Error while saving /sys/devices/pci0000:00/0000:00:1c.6/0000:06:00.0/net/wlan0/carrier: Error while reading from file: Invalid argument
Error while saving /sys/devices/pci0000:00/0000:00:1c.6/0000:06:00.0/rom: Error while reading from file: Invalid argument
Error while saving /sys/devices/pci0000:00/0000:00:1c.6/0000:06:00.0/leds/ath9k-phy0/power/autosuspend_delay_ms: Error while reading from file: Input/output error
Error while saving /sys/devices/pci0000:00/0000:00:1c.6/0000:06:00.0/power/autosuspend_delay_ms: Error while reading from file: Input/output error
Error while saving /sys/devices/pci0000:00/0000:00:1c.6/0000:06:00.0/reset: Cannot open file : Permission denied
Error while saving /sys/devices/pci0000:00/0000:00:1c.6/0000:06:00.0/ieee80211/phy0/rfkill0/power/autosuspend_delay_ms: Error while reading from file: Input/output error
Error while saving /sys/devices/pci0000:00/0000:00:1c.6/0000:06:00.0/ieee80211/phy0/power/autosuspend_delay_ms: Error while reading from file: Input/output error
Error while saving /sys/devices/pci0000:00/0000:00:1c.6/0000:06:00.0/remove: Cannot open file : Permission denied
Error while saving /sys/devices/pci0000:00/0000:00:1c.6/0000:06:00.0/rescan: Cannot open file : Permission denied
Error while saving /sys/devices/pci0000:00/0000:00:1c.6/0000:06:00.0/resource0: Error while reading from file: Input/output error
Error while saving /sys/devices/pci0000:00/0000:00:1c.6/remove: Cannot open file : Permission denied
Error while saving /sys/devices/pci0000:00/0000:00:1c.6/rescan: Cannot open file : Permission denied
Error while saving /sys/devices/pci0000:00/0000:00:1c.6/pci_bus/0000:06/power/autosuspend_delay_ms: Error while reading from file: Input/output error
Error while saving /sys/devices/pci0000:00/0000:00:1c.6/pci_bus/0000:06/rescan: Cannot open file : Permission denied
Error while saving /sys/devices/pci0000:00/0000:00:1c.7/power/autosuspend_delay_ms: Error while reading from file: Input/output error
Error while saving /sys/devices/pci0000:00/0000:00:1c.7/reset: Cannot open file : Permission denied
Error while saving /sys/devices/pci0000:00/0000:00:1c.7/0000:07:00.0/usb5/5-1/ep_00/power/autosuspend_delay_ms: Error while reading from file: Input/output error
Error while saving /sys/devices/pci0000:00/0000:00:1c.7/0000:07:00.0/usb5/5-1/5-1:1.0/ep_87/power/autosuspend_delay_ms: Error while reading from file: Input/output error
Error while saving /sys/devices/pci0000:00/0000:00:1c.7/0000:07:00.0/usb5/5-1/5-1:1.0/input/input15/power/autosuspend_delay_ms: Error while reading from file: Input/output error
Error while saving /sys/devices/pci0000:00/0000:00:1c.7/0000:07:00.0/usb5/5-1/5-1:1.0/input/input15/event15/power/autosuspend_delay_ms: Error while reading from file: Input/output error
Error while saving /sys/devices/pci0000:00/0000:00:1c.7/0000:07:00.0/usb5/5-1/5-1:1.0/video4linux/video0/power/autosuspend_delay_ms: Error while reading from file: Input/output error
Error while saving /sys/devices/pci0000:00/0000:00:1c.7/0000:07:00.0/usb5/5-1/5-1:1.2/sound/card1/power/autosuspend_delay_ms: Error while reading from file: Input/output error
Error while saving /sys/devices/pci0000:00/0000:00:1c.7/0000:07:00.0/usb5/5-1/5-1:1.2/sound/card1/controlC1/power/autosuspend_delay_ms: Error while reading from file: Input/output error
Error while saving /sys/devices/pci0000:00/0000:00:1c.7/0000:07:00.0/usb5/5-1/5-1:1.2/sound/card1/pcmC1D0c/power/autosuspend_delay_ms: Error while reading from file: Input/output error
Error while saving /sys/devices/pci0000:00/0000:00:1c.7/0000:07:00.0/usb5/5-1/remove: Cannot open file : Permission denied
Error while saving /sys/devices/pci0000:00/0000:00:1c.7/0000:07:00.0/usb5/5-2/ep_00/power/autosuspend_delay_ms: Error while reading from file: Input/output error
Error while saving /sys/devices/pci0000:00/0000:00:1c.7/0000:07:00.0/usb5/5-2/5-2:1.0/ep_02/power/autosuspend_delay_ms: Error while reading from file: Input/output error
Error while saving /sys/devices/pci0000:00/0000:00:1c.7/0000:07:00.0/usb5/5-2/5-2:1.0/ep_81/power/autosuspend_delay_ms: Error while reading from file: Input/output error
Error while saving /sys/devices/pci0000:00/0000:00:1c.7/0000:07:00.0/usb5/5-2/5-2:1.0/host10/scsi_host/host10/scan: Cannot open file : Permission denied
Error while saving /sys/devices/pci0000:00/0000:00:1c.7/0000:07:00.0/usb5/5-2/5-2:1.0/host10/scsi_host/host10/power/autosuspend_delay_ms: Error while reading from file: Input/output error
Error while saving /sys/devices/pci0000:00/0000:00:1c.7/0000:07:00.0/usb5/5-2/5-2:1.0/host10/scsi_host/host10/host_reset: Cannot open file : Permission denied
Error while saving /sys/devices/pci0000:00/0000:00:1c.7/0000:07:00.0/usb5/5-2/5-2:1.0/host10/power/autosuspend_delay_ms: Error while reading from file: Input/output error
Error while saving /sys/devices/pci0000:00/0000:00:1c.7/0000:07:00.0/usb5/5-2/5-2:1.0/host10/target10:0:0/power/autosuspend_delay_ms: Error while reading from file: Input/output error
Error while saving /sys/devices/pci0000:00/0000:00:1c.7/0000:07:00.0/usb5/5-2/5-2:1.0/host10/target10:0:0/10:0:0:0/bsg/10:0:0:0/power/autosuspend_delay_ms: Error while reading from file: Input/output error
Error while saving /sys/devices/pci0000:00/0000:00:1c.7/0000:07:00.0/usb5/5-2/5-2:1.0/host10/target10:0:0/10:0:0:0/scsi_disk/10:0:0:0/power/autosuspend_delay_ms: Error while reading from file: Input/output error
Error while saving /sys/devices/pci0000:00/0000:00:1c.7/0000:07:00.0/usb5/5-2/5-2:1.0/host10/target10:0:0/10:0:0:0/block/sdf/sdf1/power/autosuspend_delay_ms: Error while reading from file: Input/output error
Error while saving /sys/devices/pci0000:00/0000:00:1c.7/0000:07:00.0/usb5/5-2/5-2:1.0/host10/target10:0:0/10:0:0:0/block/sdf/power/autosuspend_delay_ms: Error while reading from file: Input/output error
Error while saving /sys/devices/pci0000:00/0000:00:1c.7/0000:07:00.0/usb5/5-2/5-2:1.0/host10/target10:0:0/10:0:0:0/power/autosuspend_delay_ms: Error while reading from file: Input/output error
Error while saving /sys/devices/pci0000:00/0000:00:1c.7/0000:07:00.0/usb5/5-2/5-2:1.0/host10/target10:0:0/10:0:0:0/delete: Cannot open file : Permission denied
Error while saving /sys/devices/pci0000:00/0000:00:1c.7/0000:07:00.0/usb5/5-2/5-2:1.0/host10/target10:0:0/10:0:0:0/scsi_generic/sg6/power/autosuspend_delay_ms: Error while reading from file: Input/output error
Error while saving /sys/devices/pci0000:00/0000:00:1c.7/0000:07:00.0/usb5/5-2/5-2:1.0/host10/target10:0:0/10:0:0:0/scsi_device/10:0:0:0/power/autosuspend_delay_ms: Error while reading from file: Input/output error
Error while saving /sys/devices/pci0000:00/0000:00:1c.7/0000:07:00.0/usb5/5-2/5-2:1.0/host10/target10:0:0/10:0:0:0/rescan: Cannot open file : Permission denied
Error while saving /sys/devices/pci0000:00/0000:00:1c.7/0000:07:00.0/usb5/5-2/remove: Cannot open file : Permission denied
Error while saving /sys/devices/pci0000:00/0000:00:1c.7/0000:07:00.0/usb5/ep_00/power/autosuspend_delay_ms: Error while reading from file: Input/output error
Error while saving /sys/devices/pci0000:00/0000:00:1c.7/0000:07:00.0/usb5/5-0:1.0/ep_81/power/autosuspend_delay_ms: Error while reading from file: Input/output error
Error while saving /sys/devices/pci0000:00/0000:00:1c.7/0000:07:00.0/usb5/5-0:1.0/port1/power/autosuspend_delay_ms: Error while reading from file: Input/output error
Error while saving /sys/devices/pci0000:00/0000:00:1c.7/0000:07:00.0/usb5/5-0:1.0/port2/power/autosuspend_delay_ms: Error while reading from file: Input/output error
Error while saving /sys/devices/pci0000:00/0000:00:1c.7/0000:07:00.0/usb5/remove: Cannot open file : Permission denied
Error while saving /sys/devices/pci0000:00/0000:00:1c.7/0000:07:00.0/usb6/ep_00/power/autosuspend_delay_ms: Error while reading from file: Input/output error

bedeutet es, habe ich einen Fehler gemacht? oder die rechte (root) reichen trotzdem nicht. Wäre es besser anderes Programm zu suchen?.

danke im voraus

redknight Team-Icon

Moderator & Supporter
Avatar von redknight

Anmeldungsdatum:
30. Oktober 2008

Beiträge: 21863

Das ist einer der Gründe, warum wir von kompletten Systemkopien abraten. /proc /sys /dev und einiges anderes gehört nicht da rein. Da wirst Du immer Fehler bekommen.

Antworten |