Sponsored Content
Top Forums Shell Programming and Scripting FTP a file using Shell Scripting (Help needed) Post 302976106 by pravin27 on Friday 24th of June 2016 02:41:21 AM
Old 06-24-2016
Using Perl
Code:
use Net::FTP
my $flagFile="flag.file";
my $ftp = Net::FTP->new("host") or die "cannot connect \n";
$ftp->login("user","passwd") or die "cannot login \n";
my @list=$ftp->ls(/file/path/);
if (grep {$flagFile eq $_ }@list) {
  $ftp->get("/file/path/file.csv") or die "get failed \n";
}
$ftp->quit;

 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

help needed in shell scripting......urgent

Dear friends, please help me to solve following problem. I'm running a frontend application from which i'll be invoking the shell script with arguments as given below -driver -w -p "ABC XYZ" -S -ds con -dn "abc xyz" i am getting $1=-driver $2=-w $3=-p $4="ABC $5=XYZ" $6=-S $7=-ds... (3 Replies)
Discussion started by: swamymns
3 Replies

2. Shell Programming and Scripting

Help needed - shell scripting

I have a file that has text in the format below ABC / Some text / ABC / Some text / ABC / Some text / ABC / Some text / ABC / Some text / How can I seperate the text between a pair of 'ABC' into seperate files ??? any information would be of great help. Thanks (8 Replies)
Discussion started by: garric
8 Replies

3. Shell Programming and Scripting

SHell Scripting Help Needed

Dear All, I have an input file like this interface Serial10/0/7:11.1 point-to-point description CLIENT:SA_INSTITUTO ANGLO MEXICANO Sitio Metepec 104452:0,165 bandwidth 64 ip vrf forwarding INSTITUTO-ANGLO ip address 192.168.148.217 255.255.255.252 no ip directed-broadcast frame-relay... (2 Replies)
Discussion started by: cskumar
2 Replies

4. Shell Programming and Scripting

Help needed - ksh shell scripting

Hi all, i m new to Unix shell scripting(ksh) i have a requirement, can anyone help me out in this.. spec: i need to move all the files landing in "X" directory to "Y" directory automatically everyday at a particular time.. (5 Replies)
Discussion started by: subbu
5 Replies

5. Shell Programming and Scripting

Help needed in shell scripting

" how to write a script to send an error in a log file to a particular E-Mail ID " Can anyone help me in this ? Regards (3 Replies)
Discussion started by: himvat
3 Replies

6. Shell Programming and Scripting

Help needed for shell scripting for oracle.

Hi, Please see contains both files created for automating the data from oracle through shell. 1)a_p.ksh #!/bin/ksh LOG=/home/A_P.log MESSAGE=/home/MESSAGE_A_P.txt mail_list=/home/AP_MAIL_LIST.txt data=/home/spooled_A_P.log echo "`date` Starting execution for A_P COUNT" > $LOG ... (2 Replies)
Discussion started by: fidelis
2 Replies

7. Shell Programming and Scripting

Help needed with Shell scripting

Hi All, I need to split a flatfile based on it's first character, I am using the following script awk '{print > "TEST_substr($0,1,1).txt"}' PROVIDER.txt It is returning files TEST_1 and TEST_2 But I am not getting the .txt file extension. I need the files like TEST_1.txt and ... (1 Reply)
Discussion started by: sam35
1 Replies

8. Shell Programming and Scripting

Shell Scripting for creating ftp and transfer file

Dear All, We run backup script to update backup file every hour. I want to create a script, which transfer these files in another server using ftp as new backup file created every hour. Files should be stored with a unique name for every hour(e.g 20130708_13:00 , 20130708_14:00 and so on) and... (13 Replies)
Discussion started by: Preeti Saini
13 Replies

9. Shell Programming and Scripting

UNIX shell scripting - help needed

Can anyone please help me to create the output file based on the attached input files using ksh script. I have 2 input files 1) inputfile1.txt 2) inputfile2.txt The script should accept 2 parametes: 1. Inputfile2.txt with 1-10,000 values ( sample file contains only 4 records) 2. Script... (5 Replies)
Discussion started by: vinus
5 Replies
XFERLOG2DLF.IN(1)					  LogReport's Lire Documentation					 XFERLOG2DLF.IN(1)

NAME
xferlog2dlf - convert FTP logs in xferlog format to DLF format SYNOPSIS
xferlog2dlf DESCRIPTION
This script reads an FTP logfile in xferlog format. Most FTP servers use this format, among these are ProFTPD, WU-FTPD. EXAMPLES
To process a log as produced in the xferlog format: $ xferlog2dlf < ftp.log xferlog2dlf will be rarely used on its own, but is more likely called by lr_log2report: $ lr_log2report xferlog < /var/log/ftp.log SEE ALSO
xferlog(5) A list of FTP servers can be found at http://linuxmafia.com/pub/linux/security/ftp-daemons. AUTHOR
Egon Willighagen <egonw@logreport.org> VERSION
$Id: xferlog2dlf.in,v 1.11 2006/07/23 13:16:35 vanbaal Exp $ COPYRIGHT
Copyright (C) 2000-2001 Stichting LogReport Foundation LogReport@LogReport.org This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program (see COPYING); if not, check with http://www.gnu.org/copyleft/gpl.html. Lire 2.1.1 2006-07-23 XFERLOG2DLF.IN(1)
All times are GMT -4. The time now is 08:24 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy