Re: hardlinking missing files from src to a dest: didn't work way I thought it would.

2019-11-14 Thread Pierre Bernhardt via rsync
Am 14.11.19 um 16:25 schrieb Pierre Bernhardt:
> Is this for linke backup reason if the source dir is different
> from the link-dest dir because of different hosts like
> 
> rsync -av --dest-link=../a a/ backuphost:b/
> 
> where on backuphost a is an older copy and b is the new
> target?
Yea, that's the reason:

Here a simple test on my same account (localhost), but should
work also on different host:

~/o is my source dir on my account (with one more file)
host:tmp/a is the last backup (with missing 3-file)
host:tmp/b is the new backup (without any file for now)

After rsync ~/tmp/b should also have all the files linked
from a which are also not modified on local ~/o/ and
created new files from o to b  which are new or modified:


pierre@in94:~$ ls -li o tmp/a tmp/b
o:
insgesamt 8
257419 -rw-r--r-- 1 pierre pierre 4 Nov 14 10:53 1
257420 -rw-r--r-- 1 pierre pierre 6 Nov 14 10:53 2

tmp/a:
insgesamt 8
257315 -rw-r--r-- 1 pierre pierre 4 Nov 14 10:53 1
257316 -rw-r--r-- 1 pierre pierre 6 Nov 14 10:53 2

tmp/b:
insgesamt 0
pierre@in94:~$ echo bluppblupp >o/3
pierre@in94:~$ echo bluppblupp >>o/1
pierre@in94:~$ ls -li o tmp/a tmp/b
o:
insgesamt 12
257419 -rw-r--r-- 1 pierre pierre 15 Nov 14 16:34 1
257420 -rw-r--r-- 1 pierre pierre  6 Nov 14 10:53 2
257421 -rw-r--r-- 1 pierre pierre 11 Nov 14 16:31 3

tmp/a:
insgesamt 8
257315 -rw-r--r-- 1 pierre pierre 4 Nov 14 10:53 1
257316 -rw-r--r-- 1 pierre pierre 6 Nov 14 10:53 2

tmp/b:
insgesamt 0
pierre@in94:~$ rsync -av --link-dest=../a o/ localhost:tmp/b/
pierre@localhost's password:
sending incremental file list
./
1
3

sent 226 bytes  received 64 bytes  30.53 bytes/sec
total size is 32  speedup is 0.11
pierre@in94:~$ ls -li o tmp/a tmp/b
o:
insgesamt 12
257419 -rw-r--r-- 1 pierre pierre 15 Nov 14 16:34 1
257420 -rw-r--r-- 1 pierre pierre  6 Nov 14 10:53 2
257421 -rw-r--r-- 1 pierre pierre 11 Nov 14 16:31 3

tmp/a:
insgesamt 8
257315 -rw-r--r-- 1 pierre pierre 4 Nov 14 10:53 1
257316 -rw-r--r-- 2 pierre pierre 6 Nov 14 10:53 2

tmp/b:
insgesamt 12
257422 -rw-r--r-- 1 pierre pierre 15 Nov 14 16:34 1
257316 -rw-r--r-- 2 pierre pierre  6 Nov 14 10:53 2
257423 -rw-r--r-- 1 pierre pierre 11 Nov 14 16:31 3

Thanks for the explaination.

Cheers,
Pierre


-- 
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html


Re: hardlinking missing files from src to a dest: didn't work way I thought it would.

2019-11-14 Thread Pierre Bernhardt via rsync
Am 14.11.19 um 15:02 schrieb Paul Slootman via rsync:
> On Thu 14 Nov 2019, Pierre Bernhardt via rsync wrote:
> So it's looking for b/a as the link-dest directory.
> 
> Use a full pathname for --link-dest to remove all uncertainty.
> E.g.:
> 
> rsync -av --link-dest=$(pwd)/a a/ b/
> 
> In this case, as the destination is also in same current directory, you
> could use:
> 
> rsync -av --link-dest=../a a/ b/
Working:

pierre@in94:~/tmp$ ls -li a b
a:
insgesamt 8
257315 -rw-r--r-- 1 pierre pierre 4 Nov 14 10:53 1
257316 -rw-r--r-- 1 pierre pierre 6 Nov 14 10:53 2

b:
insgesamt 0
pierre@in94:~/tmp$ rsync -av --link-dest=$(pwd)/a a/ b/
sending incremental file list
./

sent 98 bytes  received 19 bytes  234.00 bytes/sec
total size is 10  speedup is 0.09
pierre@in94:~/tmp$ ls -li a b
a:
insgesamt 8
257315 -rw-r--r-- 2 pierre pierre 4 Nov 14 10:53 1
257316 -rw-r--r-- 2 pierre pierre 6 Nov 14 10:53 2

b:
insgesamt 8
257315 -rw-r--r-- 2 pierre pierre 4 Nov 14 10:53 1
257316 -rw-r--r-- 2 pierre pierre 6 Nov 14 10:53 2


But it's really complex to understand. Why it's not possble to simply
create hard links if source and target is on the same filesystem and
use a simple option instead of the sourc-link-complex-option.

Is this for linke backup reason if the source dir is different
from the link-dest dir because of different hosts like

rsync -av --dest-link=../a a/ backuphost:b/

where on backuphost a is an older copy and b is the new
target?

Cheers,



-- 
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html


Re: hardlinking missing files from src to a dest: didn't work way I thought it would.

2019-11-14 Thread Paul Slootman via rsync
On Thu 14 Nov 2019, Pierre Bernhardt via rsync wrote:
> Am 14.11.19 um 10:54 schrieb Paul Slootman via rsync:
> > You need to specify the source directory as the link-dest directory.
> 
> Hi, I tried it also because it's an old question which has never worked
> for me. Instead it creates copies and not hard links:
> 
> 
> pierre@in94:~/tmp$ ls -li a b
> a:
> insgesamt 8
> 257315 -rw-r--r-- 1 pierre pierre 4 Nov 14 10:53 1
> 257316 -rw-r--r-- 1 pierre pierre 6 Nov 14 10:53 2
> 
> b:
> insgesamt 0
> pierre@in94:~/tmp$ rsync -av --link-dest=a a/ b/
> sending incremental file list
> --link-dest arg does not exist: a

There's your clue.
>From the manpage:

If DIR is a relative path, it is relative to the destination
directory.

So it's looking for b/a as the link-dest directory.

Use a full pathname for --link-dest to remove all uncertainty.
E.g.:

rsync -av --link-dest=$(pwd)/a a/ b/

In this case, as the destination is also in same current directory, you
could use:

rsync -av --link-dest=../a a/ b/


Paul

-- 
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html


Re: hardlinking missing files from src to a dest: didn't work way I thought it would.

2019-11-14 Thread Pierre Bernhardt via rsync
Am 14.11.19 um 10:54 schrieb Paul Slootman via rsync:
> You need to specify the source directory as the link-dest directory.

Hi, I tried it also because it's an old question which has never worked
for me. Instead it creates copies and not hard links:


pierre@in94:~/tmp$ ls -li a b
a:
insgesamt 8
257315 -rw-r--r-- 1 pierre pierre 4 Nov 14 10:53 1
257316 -rw-r--r-- 1 pierre pierre 6 Nov 14 10:53 2

b:
insgesamt 0
pierre@in94:~/tmp$ rsync -av --link-dest=a a/ b/
sending incremental file list
--link-dest arg does not exist: a
./
1
2

sent 194 bytes  received 95 bytes  578.00 bytes/sec
total size is 10  speedup is 0.03
pierre@in94:~/tmp$ ls -li a b
a:
insgesamt 8
257315 -rw-r--r-- 1 pierre pierre 4 Nov 14 10:53 1
257316 -rw-r--r-- 1 pierre pierre 6 Nov 14 10:53 2

b:
insgesamt 8
257312 -rw-r--r-- 1 pierre pierre 4 Nov 14 10:53 1
257313 -rw-r--r-- 1 pierre pierre 6 Nov 14 10:53 2


Any idea why it's not working?


Using cp -l is working well:

pierre@in94:~/tmp$ ls -li a b
a:
insgesamt 8
257315 -rw-r--r-- 1 pierre pierre 4 Nov 14 10:53 1
257316 -rw-r--r-- 1 pierre pierre 6 Nov 14 10:53 2

b:
insgesamt 0
pierre@in94:~/tmp$ cp -l a/* b/.
pierre@in94:~/tmp$ ls -li a b
a:
insgesamt 8
257315 -rw-r--r-- 2 pierre pierre 4 Nov 14 10:53 1
257316 -rw-r--r-- 2 pierre pierre 6 Nov 14 10:53 2

b:
insgesamt 8
257315 -rw-r--r-- 2 pierre pierre 4 Nov 14 10:53 1
257316 -rw-r--r-- 2 pierre pierre 6 Nov 14 10:53 2

Cheers,
Pierre


-- 
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html


Re: hardlinking missing files from src to a dest: didn't work way I thought it would.

2019-11-14 Thread Paul Slootman via rsync
On Thu 14 Nov 2019, L A Walsh via rsync wrote:

> Have a directory with a bunch rpms in it, mostly x86_64.
> 
> Have another directory with a bunch, mostly 'noarch'.
> 
> Some of the noarch files are already in the x86_64 dir
> and don't want to overwrite them.  They are on the same
> physical disk, so really, just want the new 'noarch' files
> hardlinked into the destination.
> 
> sitting in the noarch dir, I tried:
> rsync -auv --ignore-existing  \
>   --link-dest=/tumbleweed/. . /tumbleweed/.

This is not going to do anything useful, as you're telling it to look in
/tumbleweed/ for files that are to be placed in /tumbleweed/ i.e. the
exact same location. It's not going to do

ln /tumbleweed/foo/bar /tumbleweed/foo/bar

which is effectively what you're telling it to do.

You need to specify the source directory as the link-dest directory.


Paul

-- 
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html


hardlinking missing files from src to a dest: didn't work way I thought it would.

2019-11-14 Thread L A Walsh via rsync
Have a directory with a bunch rpms in it, mostly x86_64.

Have another directory with a bunch, mostly 'noarch'.

Some of the noarch files are already in the x86_64 dir
and don't want to overwrite them.  They are on the same
physical disk, so really, just want the new 'noarch' files
hardlinked into the destination.

sitting in the noarch dir, I tried:
rsync -auv --ignore-existing  \
  --link-dest=/tumbleweed/. . /tumbleweed/.

I'm not "too" surprised since technically I asked for it
to synchronize them, then link them into the same dir,
but thought it would at least say something or create the
link, but neither happened.

I really didn't want to copy them -- I'd really prefer the link,
so how do I have it only create a hard link from
the source files to target DIR that don't already exist
in the target?

I know I can do it with a shell script, but I thought
rsync might be faster...then again, if I count figuring out
how to do it...not so sure

How can I get rsync to do this?

Thanks...




-- 
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html