LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 06-08-2010, 08:26 AM   #1
mad_penguin
Member
 
Registered: Mar 2008
Posts: 69

Rep: Reputation: 15
time count bash script help


Hi experts!

Please help me figure how should I write a bash script to time some downloads from a server using ftp connection. ( something like: "time ftp 'options' ) I need to count the time for a list of files in a loop and output the result in a file. I a little familiar with bash and I need some help on this if someone is willing to hive me some help.

Just give me some directions on this.


Thank ya all!
 
Old 06-08-2010, 09:12 AM   #2
timmeke
Senior Member
 
Registered: Nov 2005
Location: Belgium
Distribution: Red Hat, Fedora
Posts: 1,515

Rep: Reputation: 61
- How about just calling wget (or lftp) for the transfer and examine its log for the timing?
- How about using the "here document" functionality of bash to pass FTP commands?
Code:
time ftp some_ftp_server <<EOL
  your_ftp_commands
EOL
(not tested, but should work just fine)
-You could also call the "date" command from within FTP shell, e.g.
Code:
some_ftp_command
!date >> logfile
some_other_ftp_command
"!" is used to perform system commands from within FTP.
 
  


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 script to find newest files and count them buee Programming 1 02-25-2010 06:43 PM
Need help in Bash script on Time entries manya Programming 14 08-26-2009 01:41 PM
Can I Have Some Help Writing This Bash Script Since Is My First Time Doing One? fiona79us Linux - Newbie 12 05-02-2008 10:53 AM
time a process within bash script aubrey-calm2 Linux - General 2 06-15-2007 01:39 PM
How to create a bash script to count? Alinuxnoob Programming 4 01-28-2007 10:48 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:34 PM.

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