script to ftp file (ip change)

Login or Register for Dates, Times and to Reply

Thread Tools Search this Thread
# 1  
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)?

cat ip.txt
# FTP the files
ftp -d -in <<EOF
user $user_name $password
cd /temp
# 2  
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  
Thank you!!! it work. Smilie
Login or Register for Dates, Times and to Reply

Previous Thread | Next Thread
Thread Tools Search this Thread
Search this Thread:
Advanced Search

Test Your Knowledge in Computers #197
Difficulty: Easy
C# ranked higher than C according to the TIOBE Index for October 2019.
True or False?

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Script to change file names

I have a landing directory on my unix (solaris) server, that receives the following files: MLH4301I AAOT-hhslog.610.20150805.txt MLH4301I AAOT-hhslog.611.20150805.txt MLH4301I AAOT-hhslog.612.20150805.txt MLH4301I AAOT-hhslog.613.20150805.txt and I need to add to this files the number 10000... (6 Replies)
Discussion started by: fretagi
6 Replies

2. 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

3. 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

4. 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

5. 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

6. 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

7. 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

8. 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

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

Featured Tech Videos