I have written a shell script that will connect to a FTP server and get a list of files that exists in a directory.
The FTP code is as follows. Issue - Let's say the value of FTP_DIR is "/rpt/02162014".
The issue that I am facing is , if the directory "/rpt/02162014" doesn't exists then the FTP code lists all the files that are within "/rpt" directory. The error that is thrown is as follows.
Need - What I want to do is to exit the FTP code in case the required directory doesn't exists. Note - I tried redirecting the error to standard output but its not working.
Kindly let me know how to exit the FTP code in case of absence of directory on FTP server.
Cheers!
Moderator's Comments:
Please use next time code tags for your code and data, thanks
Last edited by vbe; 02-25-2014 at 05:43 AM..
Reason: code tags...
All,
I am getting the following error while I am trying to ftp a file. I am able to log into the destination server. But, when I try to put the file, I get the following error: 426 Connection closed; transfer aborted.
Any ideas are appreciated.
ThankYou,
Radhika. (1 Reply)
Ok, currently we ftp a file from our Unix server to windows and then to a secureftp.'something'.com site. I am trying to bypass the windows server piece. But when I try to ftp directly from Unix to secure.'something'.com site, I see this error:
220 Check Point FireWall-1 Secure FTP server running... (7 Replies)
This used to work , but know I am getting errors:
331 Enter password
230 User logged in
250 Command CWD succeed
200 Transfer mode set to BINARY
local: arc-090715.tar.gz remote: arc-090715.tar.gz
local: arc-090715.tar.gz: No such file or directory
Any idea what is wrong? Thank you in... (2 Replies)
Hi
I have like this
----------------------------------
echo "Enter ip "
read ans_ip
echo "Enter environment"
read ans_env
echo "Enter Datacenter "
read ans_dc
loop()
{
ftp -v -n hostname << EOF
user user pwd
bin
prompt (4 Replies)
While log in to ftp server with valid username & password I receive the following error. Please advice.
ftp: Login failed.
ftp: bind: Address already in use
cat .netric
machine hostnameofmachine login username password passwordstring
.netric file set to chmod 0600 $HOME/.netrc (1 Reply)
Hi All,
I have a problem when uploading txt file from windows to Unix server.
I got 533 I/O error. I am using .bat file and it works for other batches but with this particular batch it doesn't work.
thanks guys for helping in advance. (2 Replies)
While doing ftp I am getting below error. Plz help how to resolve this?
OOPS: close
OOPS: child died
No control connection for command: Error 0
No control connection for command: Error 0
No control connection for command: Error 0
No control connection for command: Error 0
No control... (2 Replies)
i try to put files to ftp server.
but i got "550 Command STOR failed" error.
can u help me about this error?
my codes:
-bash-3.00$ ftp xxx.com
Connected to xxx.com
220 xxx.com X2 WS_FTP Server 7.5(39687500)
Name (xxx.com:oracle): user
331 Enter password
Password:
230 User logged in... (2 Replies)
Hi,
While doing FTP am getting an error like
Connected to xxxx (xxxx).
220 (vsFTPd 2.0.5)
Name (xxxx:nn): yy
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> dir */*/*/*.zip
227 Entering Passive... (6 Replies)
Hi All,
Please hav a look at the below peice of script and let me know if there are any syntax errors.
i found that the below peice of Script is causing issue. when i use SFTP its working fine, but there is a demand to use FTP only. please find below code and explain if anything is wrong... (1 Reply)
Discussion started by: mahi_mayu069
1 Replies
LEARN ABOUT PLAN9
ftpconfig
ftpconfig(1M) System Administration Commands ftpconfig(1M)NAME
ftpconfig - set up anonymous FTP
SYNOPSIS
ftpconfig [ftpdir]
ftpconfig -d ftpdir
DESCRIPTION
The ftpconfig script is executed by the super user to set up anonymous FTP. Anonymous FTP allows users to remotely log on to the FTP server
by specifying the user name ftp or anonymous and the user's email address as password. The anonymous users are logged on to the FTP
Server and given access to a restricted file area with its own file system root. See chroot(2). The FTP area has its own minimal system
files.
This command will copy and set up all the components needed to operate an anonymous FTP server, including creating the ftp user account,
creating device nodes, copying /usr/lib files, and copying timezone data. The passwd and group files set up have been stripped down to
prevent malicious users from finding login names on the server. The anonymous file area will be placed under ftpdir. If the ftp user
account already exists, then the current FTP area is used, and the system files in it are updated. All other files are left untouched. This
command should be run to update the anonymous FTP area's configuration whenever a system patch is installed, or the system is upgraded.
OPTIONS -d Create a new or update an existing ftpdir without creating or updating the ftp user account. Use this option when creating guest
FTP user accounts.
OPERANDS
The following operands are supported:
ftpdir The absolute pathname of the directory under which the anonymous FTP area is set up.
EXIT STATUS
The following exit values are returned:
0 Successful completion
1 Improper usage of the command
2 Command failed
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWftpu |
+-----------------------------+-----------------------------+
|Interface Stability |Evolving |
+-----------------------------+-----------------------------+
SEE ALSO ftpaddhost(1M), in.ftpd(1M), useradd(1M), chroot(2), attributes(5)SunOS 5.10 1 May 2003 ftpconfig(1M)