ssh timeout with rsync and Ubuntu 18.10Can't share an ssh connection with rsyncAdjusting rsync TCP timeoutExclude directories with 'rsync' and ssh with pull requestrsync with different userRSYNC periodically fails via SSH, broken pipeRsync -e option to sshRsync Wildcard Expansion Broken with SSHrsync with different ssh portsWhen to use ClientAliveInterval versus ServerAliveIntervalssh login fails with timeout
How can I prevent hyper evolved versions of regular creatures from wiping out their cousins?
What is the offset in a seaplane's hull?
How does one intimidate enemies without having the capacity for violence?
How is it possible to have an ability score that is less than 3?
In Japanese, what’s the difference between “Tonari ni” (となりに) and “Tsugi” (つぎ)? When would you use one over the other?
Prove that NP is closed under karp reduction?
How much RAM could one put in a typical 80386 setup?
Python: next in for loop
How did the USSR manage to innovate in an environment characterized by government censorship and high bureaucracy?
To string or not to string
The Two and the One
Do VLANs within a subnet need to have their own subnet for router on a stick?
Is it possible to do 50 km distance without any previous training?
How is the claim "I am in New York only if I am in America" the same as "If I am in New York, then I am in America?
strToHex ( string to its hex representation as string)
Why was the small council so happy for Tyrion to become the Master of Coin?
Why Is Death Allowed In the Matrix?
How can I make my BBEG immortal short of making them a Lich or Vampire?
Has the BBC provided arguments for saying Brexit being cancelled is unlikely?
Why don't electron-positron collisions release infinite energy?
Email Account under attack (really) - anything I can do?
The use of multiple foreign keys on same column in SQL Server
Why can't I see bouncing of a switch on an oscilloscope?
Why do I get two different answers for this counting problem?
ssh timeout with rsync and Ubuntu 18.10
Can't share an ssh connection with rsyncAdjusting rsync TCP timeoutExclude directories with 'rsync' and ssh with pull requestrsync with different userRSYNC periodically fails via SSH, broken pipeRsync -e option to sshRsync Wildcard Expansion Broken with SSHrsync with different ssh portsWhen to use ClientAliveInterval versus ServerAliveIntervalssh login fails with timeout
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I experienced this strange behavior with rsync command:
sudo rsync --timeout=300 --compress-level=9 -aHe "ssh -o ConnectTimeout=200 -o ServerAliveInterval=2 -ServerAliveCountMax=200" --progress --delete -z /media/Restic/* root@192.168.0.2:/DataVolume/BACKUPS/T4-Ubuntu-Restic
After few minutes, I get the error
rsync: [sender] write error: Broken pipe (32)
I tested with another concurrent ssh session in second terminal window running ping to gateway and it keeps running even when rsync breaks, it just pauses for a while when rsync breaks. It seems to me that Ubuntu kills the connection for a second or two and then resumes.
I wonder why ssh on rsync reports broken pipe immediately and does not wait for timeout 200 or 300 that I have set up in the command.
ubuntu ssh rsync
New contributor
add a comment |
I experienced this strange behavior with rsync command:
sudo rsync --timeout=300 --compress-level=9 -aHe "ssh -o ConnectTimeout=200 -o ServerAliveInterval=2 -ServerAliveCountMax=200" --progress --delete -z /media/Restic/* root@192.168.0.2:/DataVolume/BACKUPS/T4-Ubuntu-Restic
After few minutes, I get the error
rsync: [sender] write error: Broken pipe (32)
I tested with another concurrent ssh session in second terminal window running ping to gateway and it keeps running even when rsync breaks, it just pauses for a while when rsync breaks. It seems to me that Ubuntu kills the connection for a second or two and then resumes.
I wonder why ssh on rsync reports broken pipe immediately and does not wait for timeout 200 or 300 that I have set up in the command.
ubuntu ssh rsync
New contributor
1
You are missing-o
before-ServerAliveCountMax
. Is this just a copying error?
– meuh
2 days ago
add a comment |
I experienced this strange behavior with rsync command:
sudo rsync --timeout=300 --compress-level=9 -aHe "ssh -o ConnectTimeout=200 -o ServerAliveInterval=2 -ServerAliveCountMax=200" --progress --delete -z /media/Restic/* root@192.168.0.2:/DataVolume/BACKUPS/T4-Ubuntu-Restic
After few minutes, I get the error
rsync: [sender] write error: Broken pipe (32)
I tested with another concurrent ssh session in second terminal window running ping to gateway and it keeps running even when rsync breaks, it just pauses for a while when rsync breaks. It seems to me that Ubuntu kills the connection for a second or two and then resumes.
I wonder why ssh on rsync reports broken pipe immediately and does not wait for timeout 200 or 300 that I have set up in the command.
ubuntu ssh rsync
New contributor
I experienced this strange behavior with rsync command:
sudo rsync --timeout=300 --compress-level=9 -aHe "ssh -o ConnectTimeout=200 -o ServerAliveInterval=2 -ServerAliveCountMax=200" --progress --delete -z /media/Restic/* root@192.168.0.2:/DataVolume/BACKUPS/T4-Ubuntu-Restic
After few minutes, I get the error
rsync: [sender] write error: Broken pipe (32)
I tested with another concurrent ssh session in second terminal window running ping to gateway and it keeps running even when rsync breaks, it just pauses for a while when rsync breaks. It seems to me that Ubuntu kills the connection for a second or two and then resumes.
I wonder why ssh on rsync reports broken pipe immediately and does not wait for timeout 200 or 300 that I have set up in the command.
ubuntu ssh rsync
ubuntu ssh rsync
New contributor
New contributor
edited 2 days ago
fra-san
2,0211620
2,0211620
New contributor
asked 2 days ago
JanJan
61
61
New contributor
New contributor
1
You are missing-o
before-ServerAliveCountMax
. Is this just a copying error?
– meuh
2 days ago
add a comment |
1
You are missing-o
before-ServerAliveCountMax
. Is this just a copying error?
– meuh
2 days ago
1
1
You are missing
-o
before -ServerAliveCountMax
. Is this just a copying error?– meuh
2 days ago
You are missing
-o
before -ServerAliveCountMax
. Is this just a copying error?– meuh
2 days ago
add a comment |
1 Answer
1
active
oldest
votes
The --timeout
option is used to handle situations where the remote rsync
has hung or otherwise become unavailable. It means "wait for this many seconds before giving up on the remote connection".
If the connection is forcibly closed, as in your scenario, there is no longer any connection and rsync
can no longer communicate with its peer. Since it can now guarantee it will never hear from its peer it gives up and reports an error to you immediately.
Ideally you should investigate why your server is closing connections indiscriminately. In the meantime putting a loop around the transfer process may help
while :
do
rsync ... /media/Restic/ root@192.168.0.2:/DataVolume/BACKUPS/T4-Ubuntu-Restic &&
break
ss=$?
[[ -t 2 ]] && echo "Rsync failed with status $ss; retrying..." >&2
sleep 60
done
Thanks for suggestion. I was thinking of this solution, but I first need to set up ssh root on NAS for key-only authentication. I can only use root user, so I am a bit struggling, because tutorials suggest to turn off password for root completely which I can not do. I need that root can be authenticated by password OR a key, not by key only.
– Jan
2 days ago
@Jan if you want password and your destination username isroot
you need first to disable the "disallow root" setting in/etc/ssh/sshd_config
and then set a password for the account. To enable the key, take your source user'sid_rsa.pub
file and append its one-line contents to the destination user's file.ssh/authorized_keys
(create the file if necessary).
– roaima
2 days ago
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Jan is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f510469%2fssh-timeout-with-rsync-and-ubuntu-18-10%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
The --timeout
option is used to handle situations where the remote rsync
has hung or otherwise become unavailable. It means "wait for this many seconds before giving up on the remote connection".
If the connection is forcibly closed, as in your scenario, there is no longer any connection and rsync
can no longer communicate with its peer. Since it can now guarantee it will never hear from its peer it gives up and reports an error to you immediately.
Ideally you should investigate why your server is closing connections indiscriminately. In the meantime putting a loop around the transfer process may help
while :
do
rsync ... /media/Restic/ root@192.168.0.2:/DataVolume/BACKUPS/T4-Ubuntu-Restic &&
break
ss=$?
[[ -t 2 ]] && echo "Rsync failed with status $ss; retrying..." >&2
sleep 60
done
Thanks for suggestion. I was thinking of this solution, but I first need to set up ssh root on NAS for key-only authentication. I can only use root user, so I am a bit struggling, because tutorials suggest to turn off password for root completely which I can not do. I need that root can be authenticated by password OR a key, not by key only.
– Jan
2 days ago
@Jan if you want password and your destination username isroot
you need first to disable the "disallow root" setting in/etc/ssh/sshd_config
and then set a password for the account. To enable the key, take your source user'sid_rsa.pub
file and append its one-line contents to the destination user's file.ssh/authorized_keys
(create the file if necessary).
– roaima
2 days ago
add a comment |
The --timeout
option is used to handle situations where the remote rsync
has hung or otherwise become unavailable. It means "wait for this many seconds before giving up on the remote connection".
If the connection is forcibly closed, as in your scenario, there is no longer any connection and rsync
can no longer communicate with its peer. Since it can now guarantee it will never hear from its peer it gives up and reports an error to you immediately.
Ideally you should investigate why your server is closing connections indiscriminately. In the meantime putting a loop around the transfer process may help
while :
do
rsync ... /media/Restic/ root@192.168.0.2:/DataVolume/BACKUPS/T4-Ubuntu-Restic &&
break
ss=$?
[[ -t 2 ]] && echo "Rsync failed with status $ss; retrying..." >&2
sleep 60
done
Thanks for suggestion. I was thinking of this solution, but I first need to set up ssh root on NAS for key-only authentication. I can only use root user, so I am a bit struggling, because tutorials suggest to turn off password for root completely which I can not do. I need that root can be authenticated by password OR a key, not by key only.
– Jan
2 days ago
@Jan if you want password and your destination username isroot
you need first to disable the "disallow root" setting in/etc/ssh/sshd_config
and then set a password for the account. To enable the key, take your source user'sid_rsa.pub
file and append its one-line contents to the destination user's file.ssh/authorized_keys
(create the file if necessary).
– roaima
2 days ago
add a comment |
The --timeout
option is used to handle situations where the remote rsync
has hung or otherwise become unavailable. It means "wait for this many seconds before giving up on the remote connection".
If the connection is forcibly closed, as in your scenario, there is no longer any connection and rsync
can no longer communicate with its peer. Since it can now guarantee it will never hear from its peer it gives up and reports an error to you immediately.
Ideally you should investigate why your server is closing connections indiscriminately. In the meantime putting a loop around the transfer process may help
while :
do
rsync ... /media/Restic/ root@192.168.0.2:/DataVolume/BACKUPS/T4-Ubuntu-Restic &&
break
ss=$?
[[ -t 2 ]] && echo "Rsync failed with status $ss; retrying..." >&2
sleep 60
done
The --timeout
option is used to handle situations where the remote rsync
has hung or otherwise become unavailable. It means "wait for this many seconds before giving up on the remote connection".
If the connection is forcibly closed, as in your scenario, there is no longer any connection and rsync
can no longer communicate with its peer. Since it can now guarantee it will never hear from its peer it gives up and reports an error to you immediately.
Ideally you should investigate why your server is closing connections indiscriminately. In the meantime putting a loop around the transfer process may help
while :
do
rsync ... /media/Restic/ root@192.168.0.2:/DataVolume/BACKUPS/T4-Ubuntu-Restic &&
break
ss=$?
[[ -t 2 ]] && echo "Rsync failed with status $ss; retrying..." >&2
sleep 60
done
edited 2 days ago
answered 2 days ago
roaimaroaima
46k758124
46k758124
Thanks for suggestion. I was thinking of this solution, but I first need to set up ssh root on NAS for key-only authentication. I can only use root user, so I am a bit struggling, because tutorials suggest to turn off password for root completely which I can not do. I need that root can be authenticated by password OR a key, not by key only.
– Jan
2 days ago
@Jan if you want password and your destination username isroot
you need first to disable the "disallow root" setting in/etc/ssh/sshd_config
and then set a password for the account. To enable the key, take your source user'sid_rsa.pub
file and append its one-line contents to the destination user's file.ssh/authorized_keys
(create the file if necessary).
– roaima
2 days ago
add a comment |
Thanks for suggestion. I was thinking of this solution, but I first need to set up ssh root on NAS for key-only authentication. I can only use root user, so I am a bit struggling, because tutorials suggest to turn off password for root completely which I can not do. I need that root can be authenticated by password OR a key, not by key only.
– Jan
2 days ago
@Jan if you want password and your destination username isroot
you need first to disable the "disallow root" setting in/etc/ssh/sshd_config
and then set a password for the account. To enable the key, take your source user'sid_rsa.pub
file and append its one-line contents to the destination user's file.ssh/authorized_keys
(create the file if necessary).
– roaima
2 days ago
Thanks for suggestion. I was thinking of this solution, but I first need to set up ssh root on NAS for key-only authentication. I can only use root user, so I am a bit struggling, because tutorials suggest to turn off password for root completely which I can not do. I need that root can be authenticated by password OR a key, not by key only.
– Jan
2 days ago
Thanks for suggestion. I was thinking of this solution, but I first need to set up ssh root on NAS for key-only authentication. I can only use root user, so I am a bit struggling, because tutorials suggest to turn off password for root completely which I can not do. I need that root can be authenticated by password OR a key, not by key only.
– Jan
2 days ago
@Jan if you want password and your destination username is
root
you need first to disable the "disallow root" setting in /etc/ssh/sshd_config
and then set a password for the account. To enable the key, take your source user's id_rsa.pub
file and append its one-line contents to the destination user's file .ssh/authorized_keys
(create the file if necessary).– roaima
2 days ago
@Jan if you want password and your destination username is
root
you need first to disable the "disallow root" setting in /etc/ssh/sshd_config
and then set a password for the account. To enable the key, take your source user's id_rsa.pub
file and append its one-line contents to the destination user's file .ssh/authorized_keys
(create the file if necessary).– roaima
2 days ago
add a comment |
Jan is a new contributor. Be nice, and check out our Code of Conduct.
Jan is a new contributor. Be nice, and check out our Code of Conduct.
Jan is a new contributor. Be nice, and check out our Code of Conduct.
Jan is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f510469%2fssh-timeout-with-rsync-and-ubuntu-18-10%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
You are missing
-o
before-ServerAliveCountMax
. Is this just a copying error?– meuh
2 days ago