Site command used in ftp script


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Site command used in ftp script
# 1  
Old 07-12-2007
Site command used in ftp script

Hi everyone,

can someone please tell me what can be wrong here?

Script:
ftp -v -n $FTPSERVER<< EOP >$LOGFILE 2>&1
user $USERID $PASSWD
ascii
site lrecl=500
site cyl
site PRI=600
site SEC=300

lcd $FTPLOCALDIR
cd $FTPTARGETDIR
put $SOURCEFILE $TARGETFILE
quit
EOP

Output:
Connected to usfshux01-e1.amer.umusic.net.
220 USFSHUX01 FTP server (Version 4.1 Fri Nov 21 11:01:48 CST 2003) ready.
331 Password required for ftpuser.
230-Last unsuccessful login: Tue Jul 3 07:23:02 PDT 2007 on ssh from 10.131.13.17
230-Last login: Thu Jul 12 04:19:37 PDT 2007 on ftp from ::ffff:10.131.50.155
230 User ftpuser logged in.
200 Type set to A; form set to N.
500 'SITE LREC=500': command not understood.
500 'SITE CYL': command not understood.
500 'SITE PRI=600': command not understood.
500 'SITE SEC=300': command not understood.

Local directory now /taf/dev/workfiles
250 CWD command successful.
200 PORT command successful.
150 Opening data connection for P40DEV.J51.A130001.O999999.YYQ20063.NORMsw.
netout: write returned 0?
226 Transfer complete.
221 Goodbye.

Thanks in advance!
Cheers,
Sandra
# 2  
Old 07-12-2007
'site' is not an 'ftp' command.
# 3  
Old 07-12-2007
Hello Shell life,

I'm sorry for this mistake.

I'm a mainframe (adabas natural) expert and a Unix dummie. We will migrate from mainframe to unix and someone else wrote this script, but I encounter this error now, so that's why I'm here. Maybe the order is wrong, or it is wrong that it is put to capitals....

Is there somebody who can tell me something?

Thanks.

Sandra
# 4  
Old 07-12-2007
Sandra,
Try to run the ftp without the 'site' commands and see if it does
what you want.

The purpose of 'ftp' is just to transfer files amongst machines.
# 5  
Old 07-12-2007
Hi,

the ftp does work without the site commands. But we are ftp-ing to a mainframe and we need a fixed recordlenght of 500.

Thanks.

Sandra
# 6  
Old 07-12-2007
Sandra,
Run this script in the unix box where the file you want to transfer resides.
Make sure there is no '|' anywhere in the file.
If there is, then choose another character that for sure is not present in the file.
Code:
typeset -i mCnt=0
typeset -L500 mOutLine
mInpFile='your_input_file'
while [ ${mCnt} -lt 500 ]
do
 m500Chars=${m500Chars}'|'
 mCnt=${mCnt}+1
done
while read mLine
do
  mOut2=${mLine}${m500Chars}
  echo ${mOutLine} >> $$Temp
done < ${mInpFile}
sed 's/|/ /g' $$Temp > ${mInpFile}
rm -f $$Temp

# 7  
Old 07-12-2007
What OS are you using? Most ftp clients do indeed have a site command. You must have an old version of unix.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

To merge files on FTP site before getting them

I have a job that connects to FTP site, rename, get, delete a file and then process it. The renaming is done in consideration of this is one file name into which data is being accumulated many times within 24 hour cycle. This is what happens now: ftp -i $FTPHOST <<-EOF ren... (3 Replies)
Discussion started by: migurus
3 Replies

2. SCO

FTP problem with site exec command

Hello dear Users, I am for the first time in this forum. I come from Germany. Please excuse my bad englisch. My OS is SCO open Server Release 5. I have a problem whith FTP and the command "site exec" if I use the command "ftp> site chmod 777 /tmp/startkpf.sc 200 CHMOD command successful. ... (8 Replies)
Discussion started by: fla5do
8 Replies

3. Shell Programming and Scripting

lftp script to connect to external sftp site and download to internal ftp and then send email

Hi there, I'm new to shell scripting and need some help if possible? I need to create a shell script (.sh) to run as a cron job on an ubuntu linux server to connect to an external sftp sites directory using credentials (which I have) and then download to our internal ftp server and then copy... (3 Replies)
Discussion started by: ghath
3 Replies

4. UNIX for Dummies Questions & Answers

SCP -r from Secure FTP site

Hi all, My problem is simple. I would like to download the contents of a directory on an ftp site. I can access the site through windows, but there are many files and it would be too tedious to click and download each file. Thus, I am trying to use scp -r... (5 Replies)
Discussion started by: cpabrego
5 Replies

5. Shell Programming and Scripting

script for download files from ftp site

I'm new to scripting. I'm trying to write a script to download files from ftp site, the following is the script and the message i get after running the script. no files were downloaded :( Thanks advance! script: #!/usr/bin/ksh DAY=`date --date="-1 days" +%y%m%d` ftp -v -n "ftp.address" <<... (5 Replies)
Discussion started by: tiff-matt
5 Replies

6. Shell Programming and Scripting

Pulling a list of files from FTP site in a shell script

Hi, I am writting a shell script which will pull a list files (mentioned in one file 1.txt) from external FTP site (for ex: ftp://abcd.efghijk.com/). The 1.txt is in my local unix directory. I have username and password to connect the external FTP site. Also before I pull the files, I need... (0 Replies)
Discussion started by: spatra
0 Replies

7. Solaris

SITE command of FTP not working

Using FTP on Solaris 5.8, I am not able to use the SITE command. It says Invalid command. I am trying to change the permission of the transmitted files to -rw-rw-rw on the destination machine. Any help would be greatly appreciated. (2 Replies)
Discussion started by: gauravsachan
2 Replies

8. UNIX for Advanced & Expert Users

Polling an FTP site for a file

Hi, I'm after a bit of advice for the best way to collect files from an ftp server via a unix process. The main issue here is the frequency, the job needs to check for files every minute or so between 8am and 8pm and pull them down to the box if there is anything there. Originally the... (6 Replies)
Discussion started by: Peejay
6 Replies

9. Windows & DOS: Issues & Discussions

mapping FTP site as local drive

I have a small problem, there is one Win98 PC on our network, and I would like to map the FTP server that we have as one of the Win98's machine's local drives. I am by no means a Windows expert, instead my area is *NIX. The webserver is just a regualar webserver, within the LAN. I tried... (18 Replies)
Discussion started by: cerberusofhate
18 Replies

10. UNIX for Dummies Questions & Answers

ftp protocol and quot site chmod 0

i do have a problem with the transaction of pdf-files from a server to another. there was a guy who told me about this command wich i should build in my ftp.put()-method in java. the command called: about quote site chmod 0 filename.. i think its something about filerights but does someone know... (1 Reply)
Discussion started by: calmacroi
1 Replies
Login or Register to Ask a Question