Sponsored Content
Full Discussion: Using conditions in FTP
Operating Systems AIX Using conditions in FTP Post 302528972 by dateez on Wednesday 8th of June 2011 10:01:38 AM
Old 06-08-2011
Data Using conditions in FTP

I'm running a ftp script which will ftp a file xxx.dat from abcd to wxyz

In that I want to check if the file already exists or not,
1. if yes, append the current file to old file
2. else, put the file

Code I tried:

Code:
user ijkl password
cd /home/yyy
site [[ -s xxx.dat ]] && append xxx.dat xxx.dat
site [[ ! -s xxx.dat ]] && put xxx.dat xxx.dat
close
quit

could you please help me on this?

Note : xxx.dat will be created every one hour, also I can't do FTP from wxyz.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

reduce the or conditions

Hi , how can i reduce the or conditions: if ]; then whatever fi (8 Replies)
Discussion started by: hitmansilentass
8 Replies

2. UNIX for Dummies Questions & Answers

2 or more if conditions

Hello, I have a file as follows: col no:1 2 3 4 5 6 7 8 9 10 11 a 4 226 226 ch:95024048-95027592, 1y224 of 3545 223 224 ident b 53 235 235 ch:148398-148401255, 1y184 of 3187 180 186 ident awk... (3 Replies)
Discussion started by: dr_sabz
3 Replies

3. Shell Programming and Scripting

conditions

./script 89 The script will extract the last digit of the input parameter. example, that is 4. This will be compared to the last digit of the current day of the month ( like day 14; that is 4). A message will displayed on the screen indicating if the digits are the same or not. (1 Reply)
Discussion started by: singh is king
1 Replies

4. Shell Programming and Scripting

While with three conditions

Currently this is what I am trying while || && ]; do I want to continue if the first condition or both the second and third are true but I am getting a too many arguments error. Can someone help me out? (5 Replies)
Discussion started by: whdr02
5 Replies

5. Shell Programming and Scripting

IF OR with two conditions

I have this IF working fine, testing if a char is a digit: if ; then _VALUE=$_VALUE$_CHAR else _ISDIGIT="false" fi Then I add a second condition to test if the char is either a digit or a * if ]; then _VALUE=$_VALUE$_CHAR ... (11 Replies)
Discussion started by: Flavius
11 Replies

6. Shell Programming and Scripting

FTP GET with exception handeling and multiple conditions

Thanks everyone for the wonderful and helping environment.. And the problem I asked.. forget it... 4 days wait for a decent reply was such a moral booster.. (3 Replies)
Discussion started by: ReignOfChaos
3 Replies

7. Shell Programming and Scripting

Conditions in 'for' Loop

Hey guys, I've been learning shell for a few weeks now & come across an issue in one of my for loops : However I wish to add a condition (maybe if loop is best ??) when, if the variable value $line is > 24 go back to the start of my 'for' loop thus skipping my application based commands and... (3 Replies)
Discussion started by: phil0316
3 Replies

8. Shell Programming and Scripting

If conditions need

Dear Expert, Below code is for to take the backup of database by daily time stamp. I need vital help to make my script automatic sending me email if it sucess or fail. echo on @REM Seamonkey's quick date batch (MMDDYYYY format) @REM Setups %date variable @REM First parses month, day, and... (6 Replies)
Discussion started by: Alone
6 Replies

9. Shell Programming and Scripting

Errors in if conditions with to many OR conditions

Hi ALL I have a script where in i need to check for several values in if conditons but when i execute the script it throws error such as "TOO MANY ARGUMENTS" if then msg="BM VAR Issue :: bmaRequestVAR=$bmaRequestVAR , nltBMVAR=$nltBMVAR , bmaResponseVAR=$bmaResponseVAR ,... (10 Replies)
Discussion started by: nikhil jain
10 Replies

10. Shell Programming and Scripting

Conditions in if

I'm using the below one.. #!/bin/ksh File=$3 if ; then echo "Script" elif ] ;then echo "Passed k or f option" else "Please check the Input passed" fi Command line argument is "k" or -f and file is exist then... (3 Replies)
Discussion started by: Roozo
3 Replies
Authen::Simple::FTP(3pm)				User Contributed Perl Documentation				  Authen::Simple::FTP(3pm)

NAME
Authen::Simple::FTP - Simple FTP authentication SYNOPSIS
use Authen::Simple::FTP; my $ftp = Authen::Simple::FTP->new( host => 'ftp.company.com' ); if ( $ftp->authenticate( $username, $password ) ) { # successfull authentication } # or as a mod_perl Authen handler PerlModule Authen::Simple::Apache PerlModule Authen::Simple::FTP PerlSetVar AuthenSimpleFTP_host "ftp.company.com" <Location /protected> PerlAuthenHandler Authen::Simple::FTP AuthType Basic AuthName "Protected Area" Require valid-user </Location> DESCRIPTION
Authenticate against a FTP service. METHODS
* new This method takes a hash of parameters. The following options are valid: * host Connection host, can be a hostname or IP number. Defaults to "localhost". host => 'ftp.company.com' host => '10.0.0.1' * port Connection port, default to 21. port => 21 * timeout Connection timeout, defaults to 60. timeout => 60 * log Any object that supports "debug", "info", "error" and "warn". log => Log::Log4perl->get_logger('Authen::Simple::FTP') * authenticate( $username, $password ) Returns true on success and false on failure. SEE ALSO
Authen::Simple. Net::FTP. AUTHOR
Christian Hansen "ch@ngmedia.com" COPYRIGHT
This program is free software, you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.8.8 2008-03-01 Authen::Simple::FTP(3pm)
All times are GMT -4. The time now is 08:26 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy