Solved

Remove selected files from server using a list

Posted on 2004-08-28
7
306 Views
Last Modified: 2010-04-03
I have a list of files that I would live to remove from a server. Due to the large number of files and  folders, it isn't practical to select them individually.

I've successfully used the "download from list" feature in Total Commander, however this product apparently doesn't enable you to delete files from a list. My main objective is to save on storage costs so I'm still looking for a solution.

I've also looked at smartFTP but I don't think it has this functionality.

I've also tried to use the Window command prompt, but when after I enter my user name, it prompts me for my password, but it won't let me enter anything.  Assuming I can resolve the password issue, what is the command to delete files listted in text file?

Thanks!
0
Comment
Question by:tomfolinsbee
  • 2
  • 2
  • 2
  • +1
7 Comments
 
LVL 57

Accepted Solution

by:
Pete Long earned 50 total points
Comment Utility
are you trying to delete files via FTP?

the standard FTP commands are

!                delete          literal         prompt          send
?                debug           ls              put             status
append           dir             mdelete         pwd             trace
ascii            disconnect      mdir            quit            type
bell             get             mget            quote           user
binary           glob            mkdir           recv            verbose
bye              hash            mls             remotehelp
cd               help            mput            rename
close            lcd             open            rmdir
0
 
LVL 2

Assisted Solution

by:b0bmaster
b0bmaster earned 250 total points
Comment Utility
Hi,

you can do it using a FTP script file, Open notepad and type in (replace as nessary)

    open  ftp.youraddress.com
    delete file1.abc
    delete file2.abc
    delete file3.abc
    delete file4.abc
    delete file5.abc
    close
    quit

Save the file as "batch.scr"
now in command prompt type in  ftp -s:batch.scr


0
 
LVL 15

Expert Comment

by:plimpias
Comment Utility
AHH yes.. I had a 400 GB drive with a bunch of files that i needed to archive, by date. There is an awesome utility for this. Make sure u read the faq so you can get the commands u need.
Here is the download
http://www.asia-links.com/biz/download/product.asp?productid=74&folderid=77&parentid=9

here is the how to
http://www.ss64.com/nt/robocopy.html

Let me know how it goes
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

Author Comment

by:tomfolinsbee
Comment Utility
plimpias, I downloaded and unzipped a copy of robocopy. When I clicked on the exe file, my screen flashed but there were no prompt or added items in my task bar.

bObmaster,

here the script I'm trying to run:

OPEN ftp.myaddress.com
USER xxxxx
PASS xxxxx
delete /root/html/xxxx/03/82/0382752.pdf
close
quit

I'm getting a 331 error Password required for delete

I'm successfully downloading files using Total Commander using this format:
ftp://myUserID@ftp.myaddress.com/root/html/xxxx/aa/bb/0002006.pdf -> C:\Data\Archive20040821\aa\bb\03/82/0382752.pdf.  

1) Could you show me a script that includes login details and that will handle multiple folders?
2) Could you show me a script that will move the files, so I don't have to copy and then delete?

Thanks for your help!



0
 
LVL 15

Assisted Solution

by:plimpias
plimpias earned 200 total points
Comment Utility
Robocopy will need to be ran from DOS. Goto start > Run > type CMD and hit enter

You will need to navigate to the folder in which robocopy is placed. If you placed it in a folder called COPY then type in CD C:\COPY > ENTER > then type in ROBOCOPY /? this will give u all of the things u can do. You can move by date if was last modified, BY folder name, or by file name, you can tell it if the folder in which the file is empty, remove it or leave it. This is the tool you are looking for. Im sure of it. i was in the same shoes you were in.
0
 

Author Comment

by:tomfolinsbee
Comment Utility
Plimpias, thanks for the additional info.   I'm not using dates or file types to select which files to delete/move. I've got a list generated by other criteria and all the file names and folders are stored in a text file. Can robocopy read a list of files stored in a text file? I've looked at the help and it doesn't look like it.

Any idea what I might be doing wrong with that windows ftp command script above?

0
 
LVL 2

Expert Comment

by:b0bmaster
Comment Utility
Hi,

Sorry for slow reply, your script is OK sort of....

There is no PASS command. USER command syntax is like this:
     USER Name Password

Try and use your script like this - note no USER or PASS command.

   OPEN ftp.myaddress.com
   xxxxx  < Username
   xxxxx  < passoword
   delete /root/html/xxxx/03/82/0382752.pdf
   close
   quit

If you still have problems try running FTP with -n commandline:
    c:\> FTP -n -s:script.scr

Good Luck
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

I have written before on the benefits of using a Boot media other than your HDD when it has become infected.   The article I wrote about creating a bootable CD/DVD/USB (http://e-e.com/A_2343.html) was mainly concerned with building a UBCD4Win on CD …
A bootable USB key can be very handy now-a-days. My favorite USB key consists of our Windows 7 image, network card drivers (to connect up to a Ghost server), the latest BIOS updates for all of our PCs and CopyWipe (to erase a retired PC) Creating…
This tutorial will walk an individual through the process of installing the necessary services and then configuring a Windows Server 2012 system as an iSCSI target. To install the necessary roles, go to Server Manager, and select Add Roles and Featu…
This Micro Tutorial will teach you how to reformat your flash drive. Sometimes your flash drive may have issues carrying files so this will completely restore it to manufacturing settings. Make sure to backup all files before reformatting. This w…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now