FTP files are not moving/copying


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting FTP files are not moving/copying
# 1  
Old 10-10-2008
Java FTP files are not moving/copying

Hi

I want to FTP some file from one server to another server, those file should copy from one server to another and then move the same files to another folder in the same server. I have written the code but the text files are moving and coping but the remaing file are not moving or coping to another server or different folder. Would you please help on this

EX: Server1 and server2

Server1 is having folder abc/bcd/cde and having file .txt,.xls,.eof, etc..
i want to copy into Sever2 as abc/bcd/cde of all above said files
and also move to abc/bcd/cde/back in to sever1

Code:


#!/bin/sh

cd /abc/bcd/cde

FTP_SRVR=<host name>
FTP_USR=xxxxxx
FTP_PWD=zzzzzzzz

TODAYS_FILE=&DAY.&HR.&MIN.&SEC

ftp -vn <<EOF

open $FTP_SRVR
user $FTP_USR $FTP_PWD
cd /abc/bcd/cde

binary

mput $TODAYS_FILE

bye

EOF
mv /abc/bcd/cde/$TODAYS_FILE /abc/bcd/cde/back



Regards,
Sridhar
# 2  
Old 10-10-2008
What error do you get?

This looks strange to wrong:
Quote:
TODAYS_FILE=&DAY.&HR.&MIN.&SEC
This will not be substituted to any usable by the ksh or bash. Maybe you use the date command like:
Code:
TODAYS_FILE=`date +%d.%H.%M.%S`

# 3  
Old 10-10-2008
Hi

I .txt files are copying from sev1 to sev2 but the remaing files are not copying/mvoing to another file
and getting error like "mv: cannot rename /sap/DB1/hulftuser1/temp/ to /sap/DB1/hulftuser1/temp/back/tem
p/: Invalid argument"

could you please help
# 4  
Old 10-10-2008
does the /sap/DB1/hulftuser1/temp/back directory exist?
# 5  
Old 10-10-2008
hi

Yes it exists..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Copying, renaming the file ftp it from windows to Linux

Hello my dear friends, Two file are auto generated from mon - fri at different directories on same windows box.Every day i have to copy the file, rename it (specific name)and ftp it to linux box specified directory. is it possible to automate this process,If yes this has to be done from windows... (1 Reply)
Discussion started by: umesh yadav
1 Replies

2. Shell Programming and Scripting

Moving or copying first rows and last rows into another file

Hi I would like to move the first 1000 rows of my file into an output file and then move the last 1000 rows into another output file. Any help would be great Thanks (6 Replies)
Discussion started by: kylle345
6 Replies

3. Shell Programming and Scripting

[HELP] Scripts moving aging file by FTP

Hi Experts, Kindly share scripts to find aging file and ftp to another server.. Example: Find files more than 5 days and ftp to another server. Please give suggestion :) Thanks Edy (1 Reply)
Discussion started by: edydsuranta
1 Replies

4. Shell Programming and Scripting

Help needed in perl; moving or copying the variables

Hi All, I have a perl script blc.pl; i have five variables a,b,c,d and e in this script. Now I want to copy the values of these variables into a data file,say abc.dat.. Can anybody please tell me how to do this? Any help is appreciated.. Thanks in advance (2 Replies)
Discussion started by: puneetkanchi
2 Replies

5. UNIX for Dummies Questions & Answers

moving/copying files in a numerical order

Hi I am newbie to unix scripting, but i have enough knowledge to understand. I have a specific questions like, I use to collect like 3500 files per experiment, each one named like data_001.img.. data_002.img data_003.img .... data_3500.img I would like to move every 12 files in the 3500... (3 Replies)
Discussion started by: wpat
3 Replies

6. UNIX for Advanced & Expert Users

copying of files by userB, dir & files owned by userA

I am userB and have a dir /temp1 This dir is owned by me. How do I recursively copy files from another users's dir userA? I need to preserve the original user who created files, original group information, original create date, mod date etc. I tried cp -pr /home/userA/* . ... (2 Replies)
Discussion started by: Hangman2
2 Replies

7. Shell Programming and Scripting

copying files from UNIX to windows using FTP

Hi, I want to transfer the approx 10k files available on UNIX Server to Windows Server using FTP Command. is it possible? how ? Thanks in advance. Sachin. (1 Reply)
Discussion started by: ssachins
1 Replies

8. UNIX for Dummies Questions & Answers

Copying & moving en masse

I'm new to UNIX and have got some of the basics down, but I've got a puzzle I'm having difficulty working out. :confused: Scenario: Have FILE_A.JPG in DIR_A Need to copy FILE_A 200 times and rename it 200 different names. List of 200 names in NAME_FILE.TXT After renaming 200 files,... (4 Replies)
Discussion started by: anekab
4 Replies

9. Shell Programming and Scripting

moving a file to a new folder and automated ftp

how to move a file to a different folder after an automated FTP . (1 Reply)
Discussion started by: dineshr85
1 Replies

10. Solaris

copying/moving partition

I have a slice on a 72GB hard drive like this (example): /dev/dsk/c0t1d0s0 51424287 51009 50859036 1% /usr/stuff that I need to copy or move to a slice on a MUCH larger slice like this: /dev/dsk/c0t2d0s6 70592505 570236 69316344 1% /usr/newstuff What is the... (4 Replies)
Discussion started by: antalexi
4 Replies
Login or Register to Ask a Question