Solved

Remove selected files from server using a list

Posted on 2004-08-28
7
310 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
ID: 11920612
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
ID: 11921927
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
ID: 11922165
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
Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

 

Author Comment

by:tomfolinsbee
ID: 11924872
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
ID: 11925863
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
ID: 11927388
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
ID: 11933951
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Solid State Drive Performance Tips: Solid state storage technology is now a standard.  After testing and using several different brands and revisions of SSD's over the years I have put together a collection of tips,tools and suggestions that I ha…
The business world is becoming increasingly integrated with tech. It’s not just for a select few anymore — but what about if you have a small business? It may be easier than you think to integrate technology into your small business, and it’s likely…
This video teaches viewers how to encrypt an external drive that requires a password to read and edit the drive. All tasks are done in Disk Utility. Plug in the external drive you wish to encrypt: Make sure all previous data on the drive has been …
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…

839 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