LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 01-27-2006, 12:36 AM   #1
greatmenon
LQ Newbie
 
Registered: Jan 2006
Posts: 4

Rep: Reputation: 0
Log File with Mput size


Hello please see my below code and help how to get the log file with the details of mput files also with size? now iam getting the connection begintime and end time


#!/bin/sh
# **Autoftp**. Generated by menon
# Configures a new ~/.netrc
rm $HOME/.netrc
echo ***********
echo ***********
echo ***********
chmod **********
echo test log file > autoftp.log
echo Begin conection at: >> autoftp.log
date >> autoftp.log
ftp -i<<**
******************
******************
mput file1 file2

bye
**
echo End conection at: >> autoftp.log
date >> autoftp.log
# End
 
Old 02-26-2006, 08:29 PM   #2
paulsm4
Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
I presume you want to capture (or capture and filter) the output from your ftp session.

Simple.

You've already got a "here script" ("ftp -i <<!"). All you have to do is redirect that output to a file. Or pipe it through an "awk" command to do the filtering.

EXAMPLE:
Code:
ftp -i <<!
  ... some stuff
quit
! | awk '/files/ {print "size= %d\n", $2}'
I completely made up that "awk" command, but I think it gives you the idea: the example:
1) redirects "stdin" from a "here script" (like you're already doing)
2) redirects "stdout" by piping it into awk
3) "awk" looks for some pattern (I said "files"; I have no idea if that pattern
actually occurs in your ftp output)
4) Each line matching the pattern gets processed (the made-up "print" command)

I hope that helps .. PSM
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
file system size larger than fysical size:superblock or partition table corrupt klizon Linux - General 0 06-18-2004 04:18 PM
/var/log/maillog file size vaughn Linux - Software 6 12-15-2003 05:12 PM
How to control log file size in /var/log? yan Linux - General 2 10-13-2003 05:00 PM
Limiting the size of a log file ganninu Linux - General 1 09-18-2003 08:23 AM
iptables, changing log file from /var/log/messages acid2000 Linux - Networking 3 03-11-2003 08:38 PM


All times are GMT -5. The time now is 03:42 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration