Sponsored Content
Full Discussion: Error in ftping script
Top Forums Shell Programming and Scripting Error in ftping script Post 302100319 by inquirer on Tuesday 19th of December 2006 01:35:24 AM
Old 12-19-2006
Computer

Quote:
Originally Posted by Chanakya.m

SERVER="Server_NAME"
USER="i am user"
PASSWD="mypassword"

ftp -in $SERVER<<EOF
user $USER $PASSWD
mkdir Chanakya #To create directory with my name in $HOME
ls > list
put list
bye
<<EOF


-Chanakya
i noticed some errors in your script.

Code:
USER="i am user"

this is incorrect. the username should be one word and no spaces allowed. if your real user has space the first word will be used as username and th next word after the space will be used as password. that can be a reason for the "Please login with USER and PASS" error. the script was not able to log in so therefore can not create your cirectory. it is also good to check the permission of the folder so you can verify if you have rights to create a directory.

Code:
mkdir Chanakya #To create directory with my name in $HOME

hash can be used in shell script except in this case. since you are inside the ftp prompt. remove it.

Code:
ls > list

it must be a typo error. remove ">".

everything should be ok.

many thanks Smilie
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

FTPing over COM port ???

Hello. Can someone please help, or give me any advice. The company I work for has a unix machine and works over the com port rather than IP. We need to retrieve some files from it onto another unix machine and we are trying to get an ftp program to work, does anyone know any ftp programs that... (1 Reply)
Discussion started by: badge
1 Replies

2. UNIX for Dummies Questions & Answers

Ftping through unix script

Hi all, I am trying to write a script to connect to remote host and ftp some files there. The problem i am facing is,I dont know how to specify username and password for remote host through scripting. and even if i am able to connect to remote host,then how should i execute commands like mput... (17 Replies)
Discussion started by: Shiv@jad
17 Replies

3. UNIX for Dummies Questions & Answers

FTPing from XP to Solaris

Hello. I'm new to Unix. I've got a SUN Ultra 10 running Solaris 5.7 and I'm trying to FTP to it from my XP PC. My PC has an IP address of 10.0.0.3 and a Subnet of 255.255.255.0. I'm connected to the Sun machine with a crossover cable. I type "ifconfig hme0 10.0.0.5" in a shell window (as... (3 Replies)
Discussion started by: dtferreira
3 Replies

4. UNIX for Dummies Questions & Answers

ftping a file based in the size

Hi, I want to connect to a remote machine using FTP, check for the size of a file there. If it is 0 bytes, then there is no need to ftp else i have to ftp the file. Any help will be highly appreciated. (7 Replies)
Discussion started by: vikas.rao11
7 Replies

5. Shell Programming and Scripting

removing files after ftping

Hi All, I'm trying to write script to ftp some files and then need to remove these files from server. Is there any way to keep the condition that the file should be removed only after successfully transfered to the destinatino server? If in case, the file isn't been transferd, it should not be... (5 Replies)
Discussion started by: im_new
5 Replies

6. UNIX for Dummies Questions & Answers

Script for FTPing files to mainframe GDG

Hi, Request Unix gurus to kindly share a script which FTPs multiple files from Unix to a Mainframe GDG. The script should check for oldest file named as 'abc*.txt' in a directory '/dir/child'. FTP that file to MF, then remove the file from unix and then look for the next oldest file to be... (1 Reply)
Discussion started by: dsrookie
1 Replies

7. UNIX for Dummies Questions & Answers

How to remove junk (^Ò) character while FTPing

Hi All, I have been trying to FTP some data files from Windows directory to a UNIX server. The txt file in the windows contails the following data: "111~XYZ~1~Contact person’s phone number~COMMENTS~~~~" but the same line is appearing as "111~XYZ~1~Contact person^Òs phone number~COMMENTS~~~~"... (8 Replies)
Discussion started by: vkumbhakarna
8 Replies

8. UNIX for Dummies Questions & Answers

Size limit for FTPing file

Is there any size limit for FTPing file from one unix system to another? (6 Replies)
Discussion started by: swarup2008
6 Replies

9. UNIX for Dummies Questions & Answers

ftping a Zip file

i want to sftp a .zip file.when i am doing get abc.zip thenabc.zip is getting copied to my home folder. but on clicking abc.zip on my home folder to open it i am getting error message as "Unable to unarchive abc.zip into <homefolder> name" How to sftp the Zip file Thanks (1 Reply)
Discussion started by: bmrout007
1 Replies

10. Shell Programming and Scripting

Perl error file ftping

I am getting error while ftping the files to the particular destination. Source code $ftp->login() or die "not log on to destination server $server "; $ftp->cwd("$destdir") or die "\ not able to change directory to $destdir on $server ****\n"; Output: ... (1 Reply)
Discussion started by: ramkumar15
1 Replies
CREATE 
SERVER(7) SQL Commands CREATE SERVER(7) NAME
CREATE SERVER - define a new foreign server SYNOPSIS
CREATE SERVER servername [ TYPE 'servertype' ] [ VERSION 'serverversion' ] FOREIGN DATA WRAPPER fdwname [ OPTIONS ( option 'value' [, ... ] ) ] DESCRIPTION
CREATE SERVER defines a new foreign server. The user who defines the server becomes its owner. A foreign server typically encapsulates connection information that a foreign-data wrapper uses to access an external data resource. Addi- tional user-specific connection information may be specified by means of user mappings. The server name must be unique within the database. Creating a server requires USAGE privilege on the foreign-data wrapper being used. PARAMETERS
servername The name of the foreign server to be created. servertype Optional server type. serverversion Optional server version. fdwname The name of the foreign-data wrapper that manages the server. OPTIONS ( option 'value' [, ... ] ) This clause specifies the options for the server. The options typically define the connection details of the server, but the actual names and values are dependent on the server's foreign-data wrapper. NOTES
When using the dblink module (see in the documentation), the foreign server name can be used as an argument of the dblink_connect(l) func- tion to indicate the connection parameters. See also there for more examples. It is necessary to have the USAGE privilege on the foreign server to be able to use it in this way. EXAMPLES
Create a server foo that uses the built-in foreign-data wrapper default: CREATE SERVER foo FOREIGN DATA WRAPPER "default"; Create a server myserver that uses the foreign-data wrapper pgsql: CREATE SERVER myserver FOREIGN DATA WRAPPER pgsql OPTIONS (host 'foo', dbname 'foodb', port '5432'); COMPATIBILITY
CREATE SERVER conforms to ISO/IEC 9075-9 (SQL/MED). SEE ALSO
ALTER SERVER [alter_server(7)], DROP SERVER [drop_server(7)], CREATE FOREIGN DATA WRAPPER [create_foreign_data_wrapper(7)], CREATE USER MAPPING [create_user_mapping(7)] SQL - Language Statements 2010-05-14 CREATE SERVER(7)
All times are GMT -4. The time now is 09:17 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy