|
|
|
|
||||||
| comp.unix.shell Using and programming the Unix shell. |
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 |
|
Messages: n/a
Hébergeur: |
Hello,
I've got a directory full of symlinks to some documents, and this directory gets mirrored (by weex) onto an ftp server. When deciding which files to transfer, weex looks at the modification timestamp of the file in question. If that hasn't changed since the last transfer, the file won't be sent. My problem is that when one of the pointed-to files is modified, the mtime of the symlink doesn't change accordingly. So I tried this to sync the links' timestamps with their targets: find . -type l -printf 'touch -r "%l" "%h/%f"\n' | sh However, it seems that if used on a symlink, touch modifies the target, not the link. General question: How can the modification time of a symlink be set to an arbitrary date? Thanks, robert |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
On Nov 2, 2:08 pm, Robert Latest <boblat...@yahoo.com> wrote:
> Hello, > I've got a directory full of symlinks to some documents, and this directory > gets mirrored (by weex) onto an ftp server. > > When deciding which files to transfer, weex looks at the modification > timestamp of the file in question. If that hasn't changed since the last > transfer, the file won't be sent. > > My problem is that when one of the pointed-to files is modified, the mtime > of the symlink doesn't change accordingly. So I tried this to sync the > links' timestamps with their targets: > > find . -type l -printf 'touch -r "%l" "%h/%f"\n' | sh > > However, it seems that if used on a symlink, touch modifies the target, not > the link. > > General question: How can the modification time of a symlink be set to an > arbitrary date? > > Thanks, > robert Robert seems it is not supported by unix like kernals to change the timestamp of symlink. Found discussion at the following link: http://www.mail-archive.com/bug-core.../msg10849.html |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
Robert Latest wrote:
> > How can the modification time of a symlink be set to an > arbitrary date? Recreate you symlink with ln -sf target link_name -- Best regards | Be nice to America or they'll bring democracy to Cyrus | your country. |
|
|
|
#4 |
|
Messages: n/a
Hébergeur: |
On Nov 2, 4:28 pm, Cyrus Kriticos <cyrus.kriti...@googlemail.com>
wrote: > Robert Latest wrote: > > > How can the modification time of a symlink be set to an > > arbitrary date? > > Recreate you symlink with > > ln -sf target link_name > > -- > Best regards | Be nice to America or they'll bring democracy to > Cyrus | your country. Yeah recreating the symlink is a better option, but again changing the modification time to an arbitary date doesn't seem to be possible ? |
|
|
|
#5 |
|
Messages: n/a
Hébergeur: |
Cyrus Kriticos wrote:
> Recreate you symlink with > > ln -sf target link_name Yeah, but then it has today's date and not the one I want (namely, the date of the linked file). robert |
|
|
|
#6 |
|
Messages: n/a
Hébergeur: |
Robert Latest wrote:
> Cyrus Kriticos wrote: > >> Recreate you symlink with >> >> ln -sf target link_name > > Yeah, but then it has today's date and not the one I want (namely, the date > of the linked file). Right, my mistake. What about recreating all links as hard links? -- Best regards | Be nice to America or they'll bring democracy to Cyrus | your country. |
|
|
|
#7 |
|
Messages: n/a
Hébergeur: |
Cyrus Kriticos wrote:
> What about recreating all links as hard links? Nothing wrong with hard links. Except I don't really like 'em. Ho hum, I just might do that. robert |
|
![]() |
| Outils de la discussion | |
|
|