Re: timestamp on symlink

2002-07-29 Thread jw schultz

On Mon, Jul 29, 2002 at 12:40:56PM +1000, Martin Pool wrote:
 On 28 Jul 2002, Michael Wang [EMAIL PROTECTED] wrote:
  rsync does not sync the timestamp on symlink (Solaris 8).
  
  It is probablly due to the limitation of Unix implementation
  of symlink, but I would like to know why rsync/Unix does not
  do this, and what we can do about it. Is the conclusion that
  rsync syncs everything except the timestamp on symlink?
 
 I don't think it is possible to set the time of a symbolic link.  A
 quick experiment on Linux seems to confirm that:

SUSv3 has lstat(2) for symlinks.
Linux adds lchown(2).

The SUSv3 manpage for utime(2) has no mention of symlink
behavior and there is no lutime().  My quick tests show that
utime updates the timestamp of the file and the link is
untouched.

In general rsync is hamstrung in terms of creating links
exactly as on the source, the timestamps cannot be set and
unless you use wrap link creation in setuid() calls the
owner will be the user running rsync.

[snip]

-- 

J.W. SchultzPegasystems Technologies
email address:  [EMAIL PROTECTED]

Remember Cernan and Schmitt

-- 
To unsubscribe or change options: http://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.tuxedo.org/~esr/faqs/smart-questions.html



Re: timestamp on symlink

2002-07-29 Thread Martin Pool

On 29 Jul 2002, Donovan Baarda [EMAIL PROTECTED] wrote:
 This is because most of python's os.xxx methods de-reference symlinks. You
 get this error because 'nothere' doesn't exist. The correct way to get time
 info on symlinks is to use os.lstat(), which doesn't de-reference links.

I realize you can get the time that way (although not on all platforms),
but how do you set it?  As jw says, there is no lutime().

-- 
Martin

-- 
To unsubscribe or change options: http://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.tuxedo.org/~esr/faqs/smart-questions.html



timestamp on symlink

2002-07-28 Thread Michael Wang

rsync does not sync the timestamp on symlink (Solaris 8).

It is probablly due to the limitation of Unix implementation
of symlink, but I would like to know why rsync/Unix does not
do this, and what we can do about it. Is the conclusion that
rsync syncs everything except the timestamp on symlink?

Why do I need timestamp on symlink? Supposed something stopped
working because something removed the link, and then remake
the link. If all I have is the rsync copy, then I would have
a wrong conclusion, for example, that nobody touched the directory
since last night.

Thanks.

[root@emily:/tmp]ls -ls a/copying b/copying
   8 lrwxrwxrwx   1 root other  7 Jul 28 12:09 a/copying - COPYING
   8 lrwxrwxrwx   1 root other  7 Jul 28 12:07 b/copying - COPYING

[root@emily:/tmp]rsync -avn /tmp/a/ /tmp/b
building file list ... done
wrote 25424 bytes  read 20 bytes  16962.67 bytes/sec
total size is 15972287  speedup is 627.74

[root@emily:/tmp]rsync -av /tmp/a/ /tmp/b 
building file list ... done
./
wrote 25424 bytes  read 20 bytes  16962.67 bytes/sec
total size is 15972287  speedup is 627.74

[root@emily:/tmp]ls -ls a/copying b/copying
   8 lrwxrwxrwx   1 root other  7 Jul 28 12:09 a/copying - COPYING
   8 lrwxrwxrwx   1 root other  7 Jul 28 12:07 b/copying - COPYING

-- 
Michael Wang
http://www.unixlabplus.com/

-- 
To unsubscribe or change options: http://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.tuxedo.org/~esr/faqs/smart-questions.html



Re: timestamp on symlink

2002-07-28 Thread Donovan Baarda

On Mon, Jul 29, 2002 at 12:40:56PM +1000, Martin Pool wrote:
 On 28 Jul 2002, Michael Wang [EMAIL PROTECTED] wrote:
  rsync does not sync the timestamp on symlink (Solaris 8).
  
  It is probablly due to the limitation of Unix implementation
  of symlink, but I would like to know why rsync/Unix does not
  do this, and what we can do about it. Is the conclusion that
  rsync syncs everything except the timestamp on symlink?
 
 I don't think it is possible to set the time of a symbolic link.  A
 quick experiment on Linux seems to confirm that:
 
 !891 12:36 ~% python2.2
 Python 2.2.1 (#1, May  3 2002, 23:19:03) 
 [GCC 2.95.4 20011002 (Debian prerelease)] on linux2
 Type help, copyright, credits or license for more information.
  import os
  os.symlink('nothere', '/tmp/mylink')
  os.utime('/tmp/mylink', None)
 Traceback (most recent call last):
   File stdin, line 1, in ?
 OSError: [Errno 2] No such file or directory: '/tmp/mylink'

This is because most of python's os.xxx methods de-reference symlinks. You
get this error because 'nothere' doesn't exist. The correct way to get time
info on symlinks is to use os.lstat(), which doesn't de-reference links.

Python 2.1.3 (#1, Apr 20 2002, 10:14:34) 
[GCC 2.95.4 20011002 (Debian prerelease)] on linux2
Type copyright, credits or license for more information.
 import os
 os.symlink('nothere','mylink')
 os.lstat('mylink')
(41471, 64782L, 10L, 1, 1000, 1000, 7L, 1027913015, 1027913005, 1027913005)
 

-- 
--
ABO: finger [EMAIL PROTECTED] for more info, including pgp key
--

-- 
To unsubscribe or change options: http://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.tuxedo.org/~esr/faqs/smart-questions.html