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?

Replay

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: 3

Related post

iOS development

Android development

Python development

JAVA development

Development language

PHP development

Ruby development

search

Front-end development

Database

development tools

Open Platform

Javascript development

.NET development

cloud computing

server

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

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