To remove multiple files in FTP


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting To remove multiple files in FTP
# 1  
Old 01-04-2011
Java To remove multiple files in FTP

We have a files in FTP server..... after getting the files from FTP by

mget *.*

i hav to remove all files (multiple files) at once...

is there any command to delete multiple files at once
# 2  
Old 01-04-2011
# 3  
Old 01-04-2011
It's pretty dangerous using mget *.* and then mdel *.*

If a file is created on the ftp server your while your mget command is fetching files, this new file will not be fetched but mdel will delete it. The dnd result is you delete a file that hasn't been transfered.

So, if there is any chance of files appearing while you are fetching data you would be better off doing a ls on the remote server to get a current file list and then building a set of individual get and del commands for each file found.

Last edited by Chubler_XL; 01-04-2011 at 05:59 PM.. Reason: fix typos
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

FTP Script for Multiple Files of Same Name

Hello! I'm having a bit of trouble coming up with a script that can connect to 3 different log boxes and pull down files for that day into a single directory, where the files will all have the same name as per: stats_websites_20150801010000-20150801015959.csv.gz... (2 Replies)
Discussion started by: Cludgie
2 Replies

2. Shell Programming and Scripting

Ftp multiple files one at a time

Hi, I have a problem while ftp'ing zip files one after the other from linux source directory to a ftp host machine. here is the shell script: #!/bin/ksh dir=data/dir1/dir2 # this dir is linux source directory where zip files located. rmtdir='/home/' echo $dir for i in /$dir/*; do if ;... (7 Replies)
Discussion started by: raj78
7 Replies

3. Shell Programming and Scripting

ftp multiple files at the same time

Hi All, I am using ncftpput in one of my c-shell script to upload files to a remote location. The source files keep coming continuosly and to upload each file ncftpput opens a new connection everytime. It means ncftp uploads the file1 than file2 than file3 .... There is gap 20-25 secs between... (10 Replies)
Discussion started by: sraj142
10 Replies

4. Shell Programming and Scripting

Remove files using FTP

I am trying to remove files using FTP and used the commaned delete *.* mdelete *.* to remove the files. I am receiving an error. what is the command to delete all the files in the directory through FTP (2 Replies)
Discussion started by: bond2222
2 Replies

5. Shell Programming and Scripting

FTP multiple files from multiple directories

I have multiple files that starts as TRADE_LOG spread across multiple folders in the given structure.. ./dir1/1/TRADE_LOG*.gz ./dir2/10/TRADE_LOG*.gz ./dir11/12/TRADE_LOG*.gz ./dir12/13/TRADE_LOG*.gz when I do ftp uisng mput from the "." dir I am getting the below given error mput... (1 Reply)
Discussion started by: prasperl
1 Replies

6. Shell Programming and Scripting

get files from multiple directories using FTP

Hi, I need to download multiple files in multiple directores from other Unix server. The files could have been created by differnet user. I can use root account but I want the preserve the owner and time of the remote file. Need help on how I can do this using FTP. Thanks, Amit (2 Replies)
Discussion started by: amit1209
2 Replies

7. Shell Programming and Scripting

Help in FTP'ing multiple files

Hi, I have written the following FTP script to get the multiple files from remote server to local server. My problem is that 'mget *' is not working in the script. I also tried with 'mget *.txt', 'mget *.*' etc. without any success. It do not copy any file to local server. In the script, Prompt... (10 Replies)
Discussion started by: berlin_germany
10 Replies

8. IP Networking

Automated ftp for Multiple files

I have seen the script posted yesterday for automated ftp Can we do some thing like ftp ing multiple files in one script Example input.txt has all files names to be ftped input.txt ------ a.tar b.ccp c.perl i need to ftp all the files present in input.txt i tried something like... (0 Replies)
Discussion started by: pbsrinivas
0 Replies

9. HP-UX

how to ftp multiple files

Hi, I have to write a ftp script which transfers multiple files from one unix server to another. When I try to transfer single file it goes through successfully. But, When I try to do multiple files none of the files get ftp'd. And also, even the single file goes transferred successfully, I... (4 Replies)
Discussion started by: isingh786
4 Replies

10. Shell Programming and Scripting

FTP multiple files to different directories

The script below is written to ftp files to different directories on the destination server, but I'm not sure whether I have written the code correctly or not. Can anyone help me on this? #!/bin/sh FILE_NAMES="FileA FileB FileC" SERVER=xxxx USERID=abcd PASSWD=xxxxx... (12 Replies)
Discussion started by: abrd600
12 Replies
Login or Register to Ask a Question