Cp default timeout limit

I have a script that creates and copies a file to multiple machine on a network.

Sometimes a machine or two may be down, which in turn causes the cp to take a really long time to timeout.

My questions are:

  1. what is the default timeout of this?
  2. Can one actually override this in order to lower it?


cp, by itself, does not impose a timeout. If one of the filesystems blocks or is slow, the command could keep running for an arbitrarily long time.

You could try forcing the command to stop after a while using timeout: for example timeout 30 cp <source> <destination> would start cp and then kill it if it has not completed after 30 seconds. Depending on why, in your use case, the copy takes an abnormally long time, this may or may not do what you want.

rsync has a timeout options

        --timeout=SECONDS       set I/O timeout in seconds

you can use it as an enhanced cp.

Category: networking Time: 2016-07-31 Views: 6

Related post

iOS development

Android development

Python development

JAVA development

Development language

PHP development

Ruby development


Front-end development


development tools

Open Platform

Javascript development

.NET development

cloud computing


Copyright (C) avrocks.com, All Rights Reserved.

processed in 0.177 (s). 12 q(s)