move from one IP to another >ystrdays file


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting move from one IP to another >ystrdays file
# 1  
Old 11-10-2003
Question move from one IP to another >ystrdays file

hi forum
here is the problem i want to move ystrdays file (kept in my archive folder) from my develpment server(having a particular IP ddress) to my production server (having another IP address)

any idea how to do that i have never done transfer from one IP to another
Smilie
help on this one!!
thanks in advance
# 2  
Old 11-11-2003
Insufficient info. from your post. Don't know you want a script or command only. Anyway, you may try 'ftp' or 'rcp' commands to do that.
# 3  
Old 11-11-2003
yes i want a script which should run in the source ip from where i want the transfer
it should transfer the file to the destination IP
can u elaborate on how to use ftp in the SHELL script
actually the reason i want to transfer the files is because the files in question are previous days file
there are some scripts on the other ip which do the processing on the transferred files(previous days file)

i will enter the required script in crontab and at specified time
script will tranfer the files from source IP to destination IP
is there any way of acheiving that

thanks in advance
# 4  
Old 11-11-2003
what is the name? Do it change in everyday? I need it before preparing script.
# 5  
Old 11-11-2003
if u r talking about the file name it is fbdemo.dat
actually there are 8 files in archive folder which need to be moved
from source IP to destination IP
i hope this info will do

thanks again
# 6  
Old 11-11-2003
You may modify few of lines before running.

#!/bin/ksh

#Modify these three lines
USER=your_login_name
PASS=your_password
HOST=THE_DESTINATION_IP
FTPLOG=LOG_FOR_YOUR_REFERENCE

ftp -ivn << EOF > $FTPLOG 2>&1
open $HOST
user $USER $PASS
#If the file is binary, change it from 'asc' to 'bi'
asc
#Modify this line
cd /DESTINATION_PATH
put fbdemo.dat
bye
EOF

Then you can put this script in crontab for auto run. I will give you another post for interactive because you may think that it has a security issue on password shown in a script.
# 7  
Old 11-11-2003
You may try it for interactive use.

#!/bin/ksh

read USER?"Enter Your User Name: "
stty -echo
read PASS?"Enter Your Password: "
stty echo
print

#Modify these lines
HOST=THE_DESTINATION_IP
FTPLOG=LOG_FOR_YOUR_REFERENCE

ftp -ivn << EOF > $FTPLOG 2>&1
open $HOST
user $USER $PASS
#If the file is binary, change it from 'asc' to 'bi'
asc
#Modify this line
cd /DESTINATION_PATH
put fbdemo.dat
bye
EOF
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Move a TXT file greater or equal 355 MB with its corresponding .LST file

Good morning, i need your help please I need to move a .TXT file greater or igual 355 MB and its correspondent .LST file in a non recursive way The operating system is: uname -a SunOS server01c 5.10 Generic_144488-01 sun4u sparc SUNW,SPARC-Enterprise For example: rw-r--r-- 1 xptol ... (8 Replies)
Discussion started by: alexcol
8 Replies

2. UNIX for Beginners Questions & Answers

Move the file from one path to another using .sh file in EBS Oracle apps.

Hi All, I just want to move the file from one path to another using .sh file in EBS oracle apps. I have written in .prog but i need in .sh (file.sh) XXC_SAMPLE_FILE.prog #!/bin/bash # XXC_SAMPLE_FILE.prog DATE_TIME=`date | awk {' print $1"_"$2"_"$3"_"$4 '}` echo "parse_parms" ... (4 Replies)
Discussion started by: Mist123
4 Replies

3. Shell Programming and Scripting

Move file from one directory and update the list file once moved.

Dears, I have a listfile contains list of files path. i need to read the line of the listfile mv the file to other directory and update the listfile by deleting the lines of the listfile. #!/bin/bash target=/fstest/INVESTIG/Sadiq/TEST_ARCH while read -r line || ]; do mv $line... (19 Replies)
Discussion started by: sadique.manzar
19 Replies

4. Shell Programming and Scripting

Shell script to get the latest file from the file list and move

Hi, Anybody help me to write a Shell Script Get the latest file from the file list based on created and then move to the target directory. Tried with the following script: got error. A=$(ls -1dt $(find "cveit/local_ftp/reflash-parts" -type f -daystart -mtime -$dateoffset) | head... (2 Replies)
Discussion started by: saravan_an
2 Replies

5. Shell Programming and Scripting

Remove bad records from file and move them into a file then send those via email

Hi my requirement is that i want pull the bad records from input file and move those records in to a seperate file. that file has to be sent via email.. any suggentions please (1 Reply)
Discussion started by: sxk4999
1 Replies

6. Shell Programming and Scripting

A script that will move a file to a directory with the same name and then rename that file

Hello all. I am new to this forum (and somewhat new to UNIX / LINUX - I started using ubuntu 1 year ago).:b: I have the following problem that I have not been able to figure out how to take care of and I was wondering if anyone could help me out.:confused: I have all of my music stored in... (7 Replies)
Discussion started by: marcozd
7 Replies

7. Shell Programming and Scripting

move a file

hi, i was trying to move a file from my directoty to the home directory. * the file is not found in my directory too as it is moved but not found in the home directory i was using: cd my_dir mv filename homedir_name So kindly tell me... (2 Replies)
Discussion started by: janani_kalyan
2 Replies

8. Shell Programming and Scripting

File Move Based on 1st Character of File Name

I need some help with a unix script to mv image files to subdirectories based on the 1st character of the filename. See example below... /images/main 1191.jpg 9999.jpg A101.jpg A102.jpg B201.jpg c333.jpg ... Z999.jpg I would like to move to the following: ... (11 Replies)
Discussion started by: srdconsulting
11 Replies

9. Shell Programming and Scripting

move file

In the directory /tmp , there are some new files will be created to it by time to time , I want to mv the files that are created within 15 minutes to other direcory eg. /tmp/backup , could suggest what can I do ? thx (1 Reply)
Discussion started by: ust
1 Replies

10. UNIX for Advanced & Expert Users

help move file

my home directory is mounted on an nfs across the network. I am able to access my home directory, create files, remove files and write to a file in my home directory but when i tried to move any files from my home directory to another directory on my workstation i get an error "Permission ... (1 Reply)
Discussion started by: hassan2
1 Replies
Login or Register to Ask a Question