Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

rsync without a destination - what happens?

33 views
Skip to first unread message

Kenny McCormack

unread,
Feb 25, 2022, 12:53:20 PM2/25/22
to
I recently ran the following command:

$ rsync -avxH remotesystem:path/to/something

I.e., I forgot to put "." at the end of the line, to copy the stuff from
the remote system to the current directory.

The result of the above command was that it listed all the files (and
subdirectories and files in the subdirectories and so on), in the same
manner and format that it would if it was copying them somewhere, but (and
here's the key!) nothing was copied. I was shocked to see that after the
command finished, the current directory was (still) empty. As far as I can
tell nothing was changed - either on the local or the remote system(s).

So, what is the above command supposed to do? "man rsync" shows that the
"DEST" argument is optional, but doesn't say what happens if it is omitted.
As far as I can tell, there aren't any examples in "man rsync" that omit
DEST.

Note: When I re-ran the above command with "." at the end, it performed as
expected.

--
The randomly chosen signature file that would have appeared here is more than 4
lines long. As such, it violates one or more Usenet RFCs. In order to remain
in compliance with said RFCs, the actual sig can be found at the following URL:
http://user.xmission.com/~gazelle/Sigs/IceCream

marrgol

unread,
Feb 25, 2022, 1:30:25 PM2/25/22
to
On 25/02/2022 at 18.53, Kenny McCormack wrote:
> I recently ran the following command:
>
> $ rsync -avxH remotesystem:path/to/something
>
> I.e., I forgot to put "." at the end of the line, to copy the stuff from
> the remote system to the current directory.
>
> The result of the above command was that it listed all the files (and
> subdirectories and files in the subdirectories and so on), in the same
> manner and format that it would if it was copying them somewhere, but (and
> here's the key!) nothing was copied. I was shocked to see that after the
> command finished, the current directory was (still) empty. As far as I can
> tell nothing was changed - either on the local or the remote system(s).
>
> So, what is the above command supposed to do? "man rsync" shows that the
> "DEST" argument is optional, but doesn't say what happens if it is omitted.

Yes it does:

»As a special case, if a single source arg is specified without
a destination, the files are listed in an output format similar
to "ls -l".«


--
mrg

Lew Pitcher

unread,
Feb 25, 2022, 1:31:59 PM2/25/22
to
On Fri, 25 Feb 2022 17:53:13 +0000, Kenny McCormack wrote:

> I recently ran the following command:
>
> $ rsync -avxH remotesystem:path/to/something
>
> I.e., I forgot to put "." at the end of the line, to copy the stuff from
> the remote system to the current directory.
>
> The result of the above command was that it listed all the files (and
> subdirectories and files in the subdirectories and so on), in the same
> manner and format that it would if it was copying them somewhere, but
> (and here's the key!) nothing was copied. I was shocked to see that
> after the command finished, the current directory was (still) empty. As
> far as I can tell nothing was changed - either on the local or the
> remote system(s).
>
> So, what is the above command supposed to do? "man rsync" shows that
> the "DEST" argument is optional, but doesn't say what happens if it is
> omitted.

Actually, it does. From rsync(1):
As a special case, if a single source arg is specified without a desti-
nation, the files are listed in an output format similar to "ls -l".


> As far as I can tell, there aren't any examples in "man rsync" that omit
> DEST.
> Note: When I re-ran the above command with "." at the end, it performed
> as expected.

HTH
--
Lew Pitcher
"In Skills, We Trust"

David W. Hodgins

unread,
Feb 25, 2022, 1:45:40 PM2/25/22
to
On Fri, 25 Feb 2022 12:53:13 -0500, Kenny McCormack <gaz...@shell.xmission.com> wrote:

> I recently ran the following command:
>
> $ rsync -avxH remotesystem:path/to/something
>
> I.e., I forgot to put "." at the end of the line, to copy the stuff from
> the remote system to the current directory.
>
> The result of the above command was that it listed all the files (and
> subdirectories and files in the subdirectories and so on), in the same
> manner and format that it would if it was copying them somewhere, but (and
> here's the key!) nothing was copied. I was shocked to see that after the
> command finished, the current directory was (still) empty. As far as I can
> tell nothing was changed - either on the local or the remote system(s).
>
> So, what is the above command supposed to do? "man rsync" shows that the
> "DEST" argument is optional, but doesn't say what happens if it is omitted.
> As far as I can tell, there aren't any examples in "man rsync" that omit
> DEST.
>
> Note: When I re-ran the above command with "." at the end, it performed as
> expected.

From "man rsync" ...
if you specify no local destination then a listing of the specified files on the remote daemon is provided.

Regards, Dave Hodgins

Kenny McCormack

unread,
Feb 25, 2022, 5:46:27 PM2/25/22
to
In article <op.1h5s10i...@hodgins.homeip.net>,
David W. Hodgins <dwho...@nomail.afraid.org> wrote:
...
> From "man rsync" ...
>if you specify no local destination then a listing of the specified
>files on the remote daemon is provided.

OK. Thanks.

The man page is a bit, shall we say, dense.

Anyway, that explains it.

Incidentally, it seems odd to me that it would do this, but I suppose they
did it that way for a reason...

--
The scent of awk programmers is a lot more attractive to women than
the scent of perl programmers.

(Mike Brennan, quoted in the "GAWK" manual)
0 new messages