Solved

Remove selected files from server using a list

Posted on 2004-08-28
7
309 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
NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

 

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

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

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

AWS Glacier is Amazons cheapest storage option and is their answer to a ‘Cold’ storage service.  Customers primarily use this service for archival purposes and storage of infrastructure backups.  Its unlimited storage potential and low storage cost …
I previously wrote an article addressing the use of UBCD4WIN and SARDU. All are great, but I have always been an advocate of SARDU. Recently it was suggested that I go back and take a look at Easy2Boot in comparison.
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…

803 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