Bug 12835 - Allow --link-dest to link to an optionally unexisting directory
Allow --link-dest to link to an optionally unexisting directory
Status: NEW
Product: rsync
Classification: Unclassified
Component: core
3.1.3
All All
: P5 enhancement
: ---
Assigned To: Wayne Davison
Rsync QA Contact
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2017-06-12 10:07 UTC by Julien Palard
Modified: 2017-06-12 10:07 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Julien Palard 2017-06-12 10:07:17 UTC
Found myself trying to hardlink between versions, but as I may rsync to a new server I may not having an old version to point to, so I had to use:

  rsync -rl --link-dest=$(ssh prod "cd /var/www; readlink -e current || echo .") static index.html prod:/var/www/$CI_COMMIT_SHA/
  ssh prod "ln -nfs $CI_COMMIT_SHA" current 

Which is ugly.

I'd prefer something like:

  rsync -rl --link-dest=current static index.html prod:/var/www/$CI_COMMIT_SHA/
  ssh prod "ln -nfs $CI_COMMIT_SHA" current

But warning / erroring on missing --link-dest sound legitimate, and we may not want to change this. If not, why not introduce a --link-dest-if-exists? Or a --ignore-missing-link-dest (in combination with the normal --link-dest)?