Page 1 of 1

auto delete or clean

Posted: 2010-05-22 18:31
by TheShawnThomas
I use my FTP as temporary storage only. Does anyone know of a quick script or something that I can have automatically run, maybe as a scheduled task, that will automatically delete files that were put on the server more than a week ago?

I don't want to delete the whole folder structure because then it would have to be recreated and I want this to be something that I don't have to remember to do.

Any ideas?

Re: auto delete or clean

Posted: 2010-05-23 08:20
by boco
Moved to Off-Topic as it's not directly support for FileZilla Server.

Re: auto delete or clean

Posted: 2010-06-11 12:42
by hblevins
I've had the same question, any luck?

Re: auto delete or clean

Posted: 2010-06-11 14:01
by TheShawnThomas
Since I never got a reply I dusted off my dos commands and wrote a batch file and then just made a scheduled task that runs it every sunday night. I wanted something that would look at age of the files but this works for now. :)
the lines I used in the batch was:

del /Q /S C:\FTP_Root\clients\*.*
del /Q /S C:\FTP_Root\art\*.*

del will only delete files not folders so it will leave your folder structure intact. if you want to delete folders too use deltree.
/Q tells it to be quiet, i.e. the batch won't ask "are you sure?" before continuing.
/S tells it to delete everything in subfolders in the folder specified.
I used 2 paths so it deletes only files in those folders but nothing directly in the root.
*.* tells it to delete all files in the folders. if you wanted it to delete just word documents then you would instead use *.doc or whatever.
Of course being DOS commands this is for windows systems. If running a script on mac or linux I'm sure there are similar ways to do this with Automator or something.
If your not sure about something ask because a batch file done wrong can be worse than a virus. It's pretty easy to tell it to delete everything on the whole computer :)

Re: auto delete or clean

Posted: 2010-06-11 16:22
by boco
Just a note: The *.cmd file described in the previous post has to be run on the server itself, locally.

Re: auto delete or clean

Posted: 2010-08-01 00:41
by Xplasma
hblevins wrote:I've had the same question, any luck?
Me too.

Re: auto delete or clean

Posted: 2010-10-31 03:34
by TheShawnThomas
another solution I found that gives you more options is
http://cyber-d.blogspot.com/2005/10/cyb ... e-101.html
freeware. I don't think it runs as a service, though there are ways to fix that if you needed to. :)

Re: auto delete or clean

Posted: 2013-12-24 10:37
by nitairoy
TheShawnThomas wrote:Since I never got a reply I dusted off my dos commands and wrote a batch file and then just made a scheduled task that runs it every sunday night. I wanted something that would look at age of the files but this works for now. :)
the lines I used in the batch was:

del /Q /S C:\FTP_Root\clients\*.*
del /Q /S C:\FTP_Root\art\*.*

del will only delete files not folders so it will leave your folder structure intact. if you want to delete folders too use deltree.
/Q tells it to be quiet, i.e. the batch won't ask "are you sure?" before continuing.
/S tells it to delete everything in subfolders in the folder specified.
I used 2 paths so it deletes only files in those folders but nothing directly in the root.
*.* tells it to delete all files in the folders. if you wanted it to delete just word documents then you would instead use *.doc or whatever.
Of course being DOS commands this is for windows systems. If running a script on mac or linux I'm sure there are similar ways to do this with Automator or something.
If your not sure about something ask because a batch file done wrong can be worse than a virus. It's pretty easy to tell it to delete everything on the whole computer :)
Could you please write me how doing it if I want to delete files which are older than 15 days. I only want to delete files inside the folders not the root folder.

Re: auto delete or clean

Posted: 2014-06-28 10:52
by fionka3
Auto delete? Where is this function?

Re: auto delete or clean

Posted: 2014-06-28 13:14
by boco
FileZilla products do not support auto delete. This thread discusses an external solution.

Re: auto delete or clean

Posted: 2015-04-17 13:38
by zillawallace
interesting..I'll have to take a look later