LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-25-2010, 12:46 PM   #1
SteveInTallyFL
Member
 
Registered: May 2008
Location: Tallahassee, FL
Distribution: RHEL4, RHEL 5, OEL4, OEL5
Posts: 65

Rep: Reputation: 17
How to capture elapsed time for a file copy command


I am troubleshooting file copy time issues between 3 servers. I need to copy the same file from server A to both server B and server C and compare the elapsed times for the copy. Is there an easy way to do this?
 
Old 01-25-2010, 12:55 PM   #2
kforbus
Member
 
Registered: Sep 2009
Location: Maryland
Distribution: Slackware
Posts: 68

Rep: Reputation: 29
There's probably a better way, but I usually just do something like this:
Code:
date && cp -R folder /destination && date
That will output the date/time, run the copy command, then output the date/time again.
 
1 members found this post helpful.
Old 01-25-2010, 01:05 PM   #3
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
The time command will do that.
eg.
Code:
time scp file host:
You can pass all sorts of flags to time. Have a look at the man page.

Evo2.
 
Old 01-25-2010, 01:08 PM   #4
kforbus
Member
 
Registered: Sep 2009
Location: Maryland
Distribution: Slackware
Posts: 68

Rep: Reputation: 29
Quote:
Originally Posted by evo2 View Post
The time command will do that.
eg.
Code:
time scp file host:
You can pass all sorts of flags to time. Have a look at the man page.

Evo2.
Good call. I didn't even think about the time command.

Is it Friday yet?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Bash: how to get time (in seconds) elapsed since creation of a file? J_Szucs Linux - General 6 12-27-2008 11:28 PM
Get elapsed time HarryBoy Programming 2 08-08-2008 06:13 AM
diff. between elapsed time and cpu time madhugp Linux - General 1 01-15-2007 07:57 AM
find elapsed time innuendo_98 Programming 2 11-10-2005 08:03 AM
getting elapsed time.. Mad_C Programming 2 04-01-2003 01:12 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:11 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration