0

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

ATSiem
  • 113
  • 4
  • 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 05:01

1 Answers1

3

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.

krowe
  • 287
  • 1
  • 8
  • 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