Satish Shukla
2013-Jun-06 20:55 UTC
delaying symlinks sync until the data it points to available
Hi, Is there an easy option in rsync which enables it to sync the data first and then the symlink pointed to it. For e.g. at destination I have a symlink "new" which points to anything latest at source. The problem is that when the sync happens it updates the "new" link first before the data it is pointing to has arrived. This causes me all sorts of problem. Please don't advise me for exclude patterns since the symlinks can have different names (other than "new"). I just need that symlinks are written only after the data they are pointing is completed/done My illustration may sound simple but my data set is extremely huge and very deep dir structures and tons of symlinks under them. Probably I can get around programmatically but checking if there is an easier option that I don't know of. satish at AA:/export/universe >--> ll total 12 drwxrwxr-x 2 satish cadence1 4096 Jun 6 16:42 10.2 lrwxrwxrwx 1 satish cadence1 4 Jun 6 16:42 new -> 10.2 drwxrwxr-x 2 satish cadence1 4096 Jun 6 16:43 9.2 drwxrwxr-x 2 satish cadence1 4096 Jun 6 16:43 8.2 -SS
Wayne Davison
2013-Jun-08 15:59 UTC
delaying symlinks sync until the data it points to available
On Thu, Jun 6, 2013 at 1:55 PM, Satish Shukla <satish at cadence.com> wrote:> Is there an easy option in rsync which enables it to sync the data first > and then the symlink pointed to it.No, there is not. A couple possible other solutions: Consider using --delay-updates so that rsync moves all the completed files/symlinks into place very rapidly (make sure to use a relative --partial-dir, which is true by default). Or consider using the atomic-rsync script from the support dir which would allow you to do a normal --link-dest transfer into a new directory and (if setup with symlinks) atomically move the whole new hierarchy into place at once. ..wayne.. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.samba.org/pipermail/rsync/attachments/20130608/9e87af36/attachment.html>