ubuntuusers.de

RSYNC ---ignore-existing / "rsync chgrp...operation not permitted"

Status: Ungelöst | Ubuntu-Version: Kubuntu 12.04 (Precise Pangolin)
Antworten |

Stephan_H

Avatar von Stephan_H

Anmeldungsdatum:
18. September 2012

Beiträge: 185

Wohnort: Niederrhein / London

Hallo Forum,

Habe zwei Fragen zu Rsync:

1. die Option

--ignore-existing

sollte Dateien im Ziel ignorieren, falls diese nicht neuer (oder auch nur "anders"?) sind als die Quelldatei. Es sollte auch keine Löschungen vornehmen, falls dateien im Ziel existieren, in der Quelle aber nicht. Quelle: http://www.electrictoolbox.com/rsync-ignore-existing-update-newer/

Frage: Was ist der Unterschied zu

--update

?

Der Fall: Eine Datei im Quellverzeichnis war dateiert 30.7.14, im Ziel war (und blieb) dieselbe Datei mit Datum 9.6.14. Es funktionierte erst, als ich auf die Option

--ignore-existing

verzichtete.

Es stand also

rsync --update --progress -avzc -e "ssh -p 123" uder@192.168.3.33:/mnt/Pfad/zum/Ziel/Ordner/ /Pfad/vom/Quell/Ordner

gegen

rsync --update --ignore-existing --progress -avzc -e "ssh -p 123" uder@192.168.3.33:/mnt/Pfad/zum/Ziel/Ordner/ /Pfad/vom/Quell/Ordner

.

2. Beim Rsyncen trat ein weiterer Fehler auf:

rsync: chgrp "/mnt/Pfad/Zur/Ziel/Datei.ods/" failed: Operation not permitted (1)"

.

Keine Ahnung, warum das darein kam. Die Gruppe sollte gar nicht geändert werden. Es scheint sich aber um ein Berechtigungsproblem zu handeln. Der Fehler tritt sowohl beim Rsyncen vom Lokalrechner zum Server als auch umgekehrt auf. Es bestehen wohl unterschiedliche Zugriffsrechte zwischen Lokalen- und Serverdateien.

Der "Server" ist ein normaler 12.04LTS Rechner mit ein paar zusätzlichen Festplatten, also keine Server Edition o.Ä.

Hat jemand schon mal Ähnliches gehabt?

Gruß
Stephan

Vibaf

Ehemaliger

Anmeldungsdatum:
27. Dezember 2007

Beiträge: 3046

Zu erster Frage:

Auszug aus der man-Page von rsync:

--ignore-existing
              This tells rsync to skip updating files that already exist on the destination (this does not ignore existing directories, or nothing would get done).  See also --existing.

              This option is a transfer rule, not an exclude, so it doesn’t affect the data that goes into the file-lists, and thus it doesn’t affect deletions.  It just limits the files that the receiver requests to be transferred.

              This  option can be useful for those doing backups using the --link-dest option when they need to continue a backup run that got interrupted.  Since a --link-dest run is copied into a new directory hierarchy (when it is
              used properly), using --ignore existing will ensure that the already-handled files don’t get tweaked (which avoids a change in permissions on the hard-linked files).  This does mean that this option is only  looking  at
              the existing files in the destination hierarchy itself.

[...]

-u, --update
              This  forces  rsync  to skip any files which exist on the destination and have a modified time that is newer than the source file.  (If an existing destination file has a modification time equal to the source file’s, it
              will be updated if the sizes are different.)

              Note that this does not affect the copying of symlinks or other special files.  Also, a difference of file format between the sender and receiver is always considered to be important enough for an update, no matter what
              date is on the objects.  In other words, if the source has a directory where the destination has a file, the transfer would occur regardless of the timestamps.

              This option is a transfer rule, not an exclude, so it doesn’t affect the data that goes into the file-lists, and thus it doesn’t affect deletions.  It just limits the files that the receiver requests to be transferred.

Mit --ignore-existing wird eine Datei also nicht übertragen, wenn sie bereits vorhanden ist. Bei --update bzw. -u wird die Datei nur übertragen wenn der Timestamp aus der Quelle aktueller als der im Ziel ist oder bei gleichem Timestamp die Datei in der Quelle eine andere Größe aufweist.

Zu zweiter Frage (was eigentlich ein eigener Thread sein sollte, siehe Richtig Fragen):

Wie sehen denn die Rechte auf diese Datei aus? Oder ist das ein Verzeichnis? (/ nach Datei.ods ?)

ls -la /Pfad/zur/Datei
Antworten |