Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am trying to cleanup a 12TB Windows FTP with several million files.

Basically, I want to keep the directories that are still being used by a specific subset of users who had access, and only keep them if they were modified within the last year.

Is there a file copy tool that would allow me to do this? I reviewed robocopy, but it did not seem to have the syntax to filter by user, only file age.

Thanks! Adam

share|improve this question

closed as off-topic by Ward, Tom O'Connor Aug 26 '13 at 23:56

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions seeking product, service, or learning material recommendations are off-topic because they tend to become obsolete quickly. Instead, describe your situation and the specific problem you're trying to solve." – Ward, Tom O'Connor
If this question can be reworded to fit the rules in the help center, please edit the question.

    
Do you need to copy directory tree? –  GioMac Aug 26 '13 at 16:05
    
Robocopy is a native function of Windows. This is not about purchasing a product. I am looking for Windows Scripting functions for managing a Windows FTP Server. –  ATSiem Aug 27 '13 at 5:01

1 Answer 1

If it were me, I'd write a script for this:

find /mnt/ftp -user 'myuser' -mtime -365 -exec cp {} /home/me/tosend  \;

That command will work in Linux. If you are using Windows, then the same can probably be accomplished with Cygwin. Either way, you want to make sure the FTP is mounted to the filesystem first.

share|improve this answer
    
PS: The server OS is irrelevant, all that matters is your client OS. Meaning, that you could even throw in a Linux boot disk and take care of this easily. –  krowe Aug 26 '13 at 15:29
    
krowe, not really. Linux will know nothing about users. Regarding Cygwin and answer - it will work for sure, but it will require creation of directory tree. –  GioMac Aug 26 '13 at 16:03
    
Linux will know the user names assigned to the FTP files. It should be simple enough to make that list from either Windows or Linux just by looping through the files and writing them out. (I didn't mention how to do that part because it wasn't part of the OP) –  krowe Aug 26 '13 at 16:10
1  
Hmm...I did forget to mention how to filter by date a s well. Here is a better version: find /mnt/ftp -user 'myuser' -mtime -365 -exec cp {} /home/me/tosend \; –  krowe Aug 26 '13 at 16:17

Not the answer you're looking for? Browse other questions tagged or ask your own question.