openssh: Limiting bandwidth on ssh (stdin-to-dd) - SSH
This is a discussion on openssh: Limiting bandwidth on ssh (stdin-to-dd) - SSH ; I'm looking at using "ssh" from the openssh package, to perform secure
backups of large directories from a local server to a remote server as in
the following command executed on the local server.
>tar -cf - ./test_dir | ssh ...
-
openssh: Limiting bandwidth on ssh (stdin-to-dd)
I'm looking at using "ssh" from the openssh package, to perform secure
backups of large directories from a local server to a remote server as in
the following command executed on the local server.
>tar -cf - ./test_dir | ssh user@remote-server dd of=test_dir.tar
Ie., I don't want to first create the tar file on the local system then use
scp to copy it off, as there may not be enough disk storage on the local
system to create the tar file. However, I cannot seem to find any way, for
the above style of transfer using ssh, to do something like the "-l" option
of scp to limit the amount of bandwidth used during the transfer.
Does anybody know of a way?
Thanks,
Mark
-
Re: openssh: Limiting bandwidth on ssh (stdin-to-dd)
Mark Holden wrote:
> I'm looking at using "ssh" from the openssh package, to perform secure
> backups of large directories from a local server to a remote server
> as in the following command executed on the local server.
>
>> tar -cf - ./test_dir | ssh user@remote-server dd of=test_dir.tar
>
> Ie., I don't want to first create the tar file on the local system
> then use scp to copy it off, as there may not be enough disk storage
> on the local system to create the tar file. However, I cannot seem to
> find any way, for the above style of transfer using ssh, to do
> something like the "-l" option of scp to limit the amount of
> bandwidth used during the transfer.
>
> Does anybody know of a way?
I strongly urge you to look into using "rsync" and actually mirror the
directory itself, not the tarball. That gets you bandwidth limitation, and
vastly improves the speed of the transmission by sending only changes, not
identical files. It can even be incorporated with "rsnapshot", which can
create multiple snapshots of the filesystem on the server, hard-linked
together to save space.
-
Re: openssh: Limiting bandwidth on ssh (stdin-to-dd)
Mark Holden wrote:
> I'm looking at using "ssh" from the openssh package, to perform secure
> backups of large directories from a local server to a remote server as in
> the following command executed on the local server.
>
>>tar -cf - ./test_dir | ssh user@remote-server dd of=test_dir.tar
>
I always wondered why scp doesn't allow "-" as a source or destination spec,
it would make life that much easier
producer | scp - remote:/somewhere
or
scp remote:/somewhere - | consumer
Roman