The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
[help]Delete or replace text in multiple file and multiple directory dzufauzan Shell Programming and Scripting 16 06-05-2009 12:07 PM
Synchronization in copying multiple files to a directory amio Shell Programming and Scripting 1 03-12-2009 08:32 AM
Need to search and replace in multiple files in directory hierarchy umen Shell Programming and Scripting 3 12-24-2007 04:56 AM
How to unzip multiple files (encrypted) in a directory. er_ashu UNIX for Dummies Questions & Answers 2 07-03-2007 06:16 PM
MV files from one directory structure(multiple level) to other directory structure srmadab UNIX for Advanced & Expert Users 4 09-13-2006 05:01 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 03-16-2009
lweegp lweegp is offline
Registered User
  
 

Join Date: Oct 2005
Location: singapore
Posts: 107
ftp multiple files from same directory

Hi there Gurus,

I have the following ftp script:

$ more ftp_dump_arch4.sh
#! /usr/bin/ksh

# Constant variables
HOST='xx.xx.xx.xx'
USER='user'
PASSWD='password'
dir='/export/file'
ftp_log='/tmp'

ftp -n $HOST > $ftp_log/ftp.log << END

user $USER $PASSWD
verbose
lcd $dir
bin
mput *dmp.gz ---> any files with this dmp.gz extention will be ftp
mput * ---> the rest of the files are not copied over when there aren't any dmp.gz files available... how do i resolve this??

bye

wait
exit 0


thanks!!

wee
  #2 (permalink)  
Old 03-16-2009
vidyadhar85's Avatar
vidyadhar85 vidyadhar85 is offline Forum Staff  
Moderator(The Tutor)
  
 

Join Date: Jun 2008
Location: INDIA
Posts: 1,418
sadly you can't check such condition inside a ftp script..
you check the condition before entering the ftp..
  #3 (permalink)  
Old 03-17-2009
rikxik's Avatar
rikxik rikxik is offline
Registered User
  
 

Join Date: Dec 2007
Posts: 250
I checked and no such issue for me. It should still send all the files (*) even if .dmp.gz files are not there. You should add -i option to the ftp command or add "prompt" command before the mput. Also add -v option for debugging.
  #4 (permalink)  
Old 03-17-2009
lweegp lweegp is offline
Registered User
  
 

Join Date: Oct 2005
Location: singapore
Posts: 107
hey all,

by putting -i it works!!

thanks rikxik for the help!


wee
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 07:36 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0