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

2
  • Do you need to copy directory tree?
    – GioMac
    Aug 26, 2013 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, 2013 at 5:01

1 Answer 1

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.

4
  • 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, 2013 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, 2013 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, 2013 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, 2013 at 16:17

Not the answer you're looking for? Browse other questions tagged .