UNIX - FTP changing the mode while transfering the files


 
Thread Tools Search this Thread
Operating Systems Linux UNIX - FTP changing the mode while transfering the files
# 1  
Old 04-23-2014
UNIX - FTP changing the mode while transfering the files

Hi,

I have to transfer my files using FTP. Few files are in Zipped format (.Z) and few are in .PX format . For zipped files, we need to change the mode to binary while transferring the files whereas for the px files the mode should be ascii.

Eg: sample1.z
sample2.z
sample3.z
sample.px

where px is the count file which consists the count of the above zipped files data.
Now while transferring these files, i need to maintain the mode as binary and while transfering the last file, px file, i should change the mode to ascii. How to change the mode in the shell script ??
# 2  
Old 04-23-2014
In ftp the commands are binary and ascii respectively, so issue these commands before you do your mgets.
# 3  
Old 04-23-2014
Do you have a script? If so please post.

'binary' and 'ascii' are ftp subsystem commands which can be put inside a script.

For example:

Code:
 
 > binary
 > mput *.z
 > ascii
 > put abc.px
 > quit

Does that help? Or have I misunderstood the question?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

FTP to send files using Binary mode

I am using below code to send files into ascii mode.what changes will I have to do to send files into Binary mode ? ftp -in <<FIN open $SAP_UP_SERVER user $SAP_UP_USER $SAP_UP_PASSWORD asc put $PM00_OUTPUTS_DIRECTORY/$SAP_UP_FILE_CSV /SAP_UP_FILE_CSV quit FIN (1 Reply)
Discussion started by: Nitin Varshneya
1 Replies

2. UNIX for Advanced & Expert Users

FTP While transfering files to local machine to remote machine

Hi Am using unix Ksh Am getting the problem while transferring zero size files through the script . When i transfer zero size files from local machine to remote machine manually i can able to do it . My question its beause of zero size files am not able to transfer through script ? or its... (2 Replies)
Discussion started by: Venkatesh1
2 Replies

3. Shell Programming and Scripting

FTP using script not working (for transfering file from a remote unix server to windows PC.)

hi, Im using the following code for FTP #!/usr/bin/ksh ftp -v -n "10.29.45.11" << cmd user "mahesva" "mahesva123" get rtl.tar quit cmd Below is the log when i run the above code ********************************** Connected to 10.29.45.11. 220 (vsFTPd 2.0.1) 530 Please login with USER... (20 Replies)
Discussion started by: dll_fpga
20 Replies

4. Shell Programming and Scripting

ftp script for transfering files

Hi, I am new to shell scripting,and i was planning to write a script that will FTP files to destination folder. All configuration should be done through a properties files.I was planning that All configuration should be done through a properties files. and finally the output should be... (0 Replies)
Discussion started by: rahul125
0 Replies

5. UNIX for Dummies Questions & Answers

changing mode of files in subdirectories

Hi I actually need to change the mode to 777 in the current directory as well as subdirectories how to achieve that. I have /usr/sol/home/workfold as the main directory there are many directies and files in the workfold directory . I need to chmod 777 to all the directories and files under... (2 Replies)
Discussion started by: ssuresh1999
2 Replies

6. UNIX for Advanced & Expert Users

FTP is not transfering pdf files correctly

HI Experts, I have following code to FTP all pdf files from remote (win sever) to Linux box. function LsFiles(){ ftp -n -i -v $HT <<end_ftp user $USR $PASSWD cd $DIRNAME ls "-lrt *.pdf" bye end_ftp } LsFiles > list_of_files.txt function getFiles(){ ftp -n -i -v $HT <<end_ftp... (2 Replies)
Discussion started by: dipeshvshah
2 Replies

7. UNIX for Dummies Questions & Answers

Get files using https mode in unix scripts

Hello Friends, I have a requirement to connect and get files from a server using https protocol. 1) COuld you please advise on how to establish connection between my server and remote server to get files using https mode. any special procedure apart from FTP ? 2) also give me some code... (5 Replies)
Discussion started by: mohanpadamata
5 Replies

8. Shell Programming and Scripting

Transfering files from windows to unix box through sftp

Hello All, we have scenarion where we need to pull the Files from Windows to Unix Box through SFTP protocol. as per our analysis we did install the cygwin package on the Windows Box to have the openSSH package functionality. 1.Will openSSH help us to achieve the functionality what we are... (3 Replies)
Discussion started by: Amey Joshi
3 Replies

9. IP Networking

Transfering file through FTP through Binary Mode

Hi, I'm uploading files using internet explorer. 1.Open internet explorer 6.0 2.Open site like ftp://172.45.15.1 3.Copy files The files which I'm copying are basically zip files. What is the default transfer mode, I mean ASCII/BINARY ???. The problem I'm facing, while extracting these... (4 Replies)
Discussion started by: ronald_brayan
4 Replies

10. UNIX for Dummies Questions & Answers

transfering files unix to pc

Hi, I'm an intern at a business that just acquired a company that ran off the unix system. They have files on this workstation that they would like to move to a windows XP pro system, but no one (myself included) has enough unix knowledge to know how to do this. It's my understanding that this can... (8 Replies)
Discussion started by: intern
8 Replies
Login or Register to Ask a Question