script to ftp file (ip change)


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting script to ftp file (ip change)
# 1  
Old 09-19-2006
script to ftp file (ip change)

Hi All,
If I want to ftp files from machine to local pc. But the ip must change everytime Smilie (due to VPN), can I write a script to easiler (no need to update ip in script)?

user_name=aaa
password=bbb
cat ip.txt
#
# FTP the files
#
ftp -d -in 199.200.204.109 <<EOF
user $user_name $password
bin
cd /temp
# 2  
Old 09-19-2006
if you have file with ip address (i.e. ip.txt) you can use it in your script.
write `cat ip.txt` instead of ip address in ftp command (don't change back quotes)
# 3  
Old 09-19-2006
Thank you!!! it work. Smilie
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Ftp bash script appends to file using cron instead of coping new file

I have a bash script that is running a mysql query and creating a csv file with a time stamp. It then uploads that to a ftp server. Everything works great when I manually run it. But then I have a cron job set to run every monday, wednesday and friday at 5am est. When the cron job runs, it... (7 Replies)
Discussion started by: akallenberger
7 Replies

2. Shell Programming and Scripting

Script to change name of a file with date

I have a file that contains todays date(for ex- test_08/30/2013) Now I want a script which will run and change the name of the file and put yesterday's date (for ex- test_08/29/2013) Please help. ---------- Post updated at 04:40 AM ---------- Previous update was at 04:31 AM ---------- I... (2 Replies)
Discussion started by: sv0081493
2 Replies

3. Shell Programming and Scripting

Needed script to FTP a File and generate a quality checksum file

hi all i want a script to FTP a file and should generate a quality checksum file means when I FTP a file from one server to another server it should generate a QC file which should contain timestamp,no.of records in that file Thanks in advance saikumar (3 Replies)
Discussion started by: hemanthsaikumar
3 Replies

4. UNIX for Dummies Questions & Answers

Script to change file name

Hi, I need to write a script that changes the name of the filename. Let's say my script is named change_filename and I want to use it on a file named test1.txt. After running the script I want the filename renamed to test1_fails.txt e.g. $ ls test1.txt test2.txt test3.txt $ ... (15 Replies)
Discussion started by: millsy5
15 Replies

5. Shell Programming and Scripting

change file contents using script

Hi, Requirement:- Need to change pfile,so while executing script,it has to go to pfile location(ORACLE_HOME/dbs) and open init<SID>.ora file and change value db_name=<>. If db_name=abcd,script will change the db_name=1234 likr that.. Please help to code this (1 Reply)
Discussion started by: Sanal
1 Replies

6. Shell Programming and Scripting

ftp file and change prefix

Hi, i want to ftp to another server and change the prefix of the file and change direcotry also. but i am unable to get it. any ideas will be helpful? ftp -n ${HOST} <<END quote USER $USER quote PASS $PASS cd /dir/dir put file mv file fnl.fileEND END (2 Replies)
Discussion started by: dazdseg
2 Replies

7. Shell Programming and Scripting

change the mode of the file after FTP

Hi I am FTPing a file to a remote server from my local server. But after I FTP it the permissions are not in executable option, I need to change the permissions of the FTPed file how can i do that. Below is my script LOCALDIR=/batch/ediprocess LOCAL_BACKUP_DIR/batch/ediprocessBackUp... (4 Replies)
Discussion started by: shanth_chandra
4 Replies

8. Shell Programming and Scripting

Need help script to change the log file?

Hi I have log like this : And i want the log become like this : can somebody help me?? (5 Replies)
Discussion started by: justbow
5 Replies

9. Shell Programming and Scripting

FTP script to FTP file to UNIX - Solaris

Hello, A couple of times per week, i receive emails notifications when files are available for processing. Currently i read these eamails with a java program and store the attachement on my C: drive and would now like to generate a PC script to send this file name up to UNIX-Solaris and... (3 Replies)
Discussion started by: bobk544
3 Replies

10. UNIX for Dummies Questions & Answers

script to change value in file

Hi, I have a parameter file and it contains following items $ cat TransactionParams From_Date_Parm=2005-02-25 To_Date_Parm=2005-05-25 Extract_Root_Parm=/detld1/etl/ascential/Ascential/DataStage/Projects/CTI_London/IAM Extract_Type_Parm=Transaction EDW_Database_Parm=hdw_erks... (1 Reply)
Discussion started by: gopskrish
1 Replies
Login or Register to Ask a Question