rsync non-existent path hangs
I have a list of syncs to perform, but sometimes they are not present on the remote server.
Is there a way to get it to gracefully skip/pass over these? rsync -a server:/does/not/exist /here Currently it hangs for ages and then bails out with `ssh: connect to host server port 22: Operation timed out` |
Are you running a script for this? If so maybe you should check for the the files or directories exist before the command is executed. I'm not a programmer but maybe something like this would work;
Code:
if [ -e server:/does/exist ]; then |
Code:
if ssh user@server "[[ -e /path/to/file]]" ; then |
Quote:
Skipping over remote servers that are not available with a very small delay leads to the risk of having false positives... i.e. skipping over servers that actually are available and are just responding slowly. That's what timeouts are for! That said, what you could do is reducing the timeout. If the syncs are on a fast link (local area network) you might want to reduce the connection timeout to a second or so: Code:
ssh -o ConnectTimeout=1 <hostName> |
All times are GMT -5. The time now is 09:20 PM. |