auto delete or clean

Have the feeling that everybody is staring at you in the other forums? Then look here, in this forum nobody does care what you say ;-)

Moderator: Project members

Post Reply
Message
Author
TheShawnThomas
500 Command not understood
Posts: 5
Joined: 2010-05-22 18:22
First name: Shawn
Last name: Thomas

auto delete or clean

#1 Post by TheShawnThomas » 2010-05-22 18:31

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?

User avatar
boco
Contributor
Posts: 26930
Joined: 2006-05-01 03:28
Location: Germany

Re: auto delete or clean

#2 Post by boco » 2010-05-23 08:20

Moved to Off-Topic as it's not directly support for FileZilla Server.
No support requests over PM! You will NOT get any reply!!!
FTP connection problems? Please read Network Configuration.
FileZilla connection test: https://filezilla-project.org/conntest.php
FileZilla Pro support: https://customerforum.fileZilla-project.org

hblevins
500 Command not understood
Posts: 1
Joined: 2010-06-11 12:28
First name: Harold
Last name: Blevins

Re: auto delete or clean

#3 Post by hblevins » 2010-06-11 12:42

I've had the same question, any luck?

TheShawnThomas
500 Command not understood
Posts: 5
Joined: 2010-05-22 18:22
First name: Shawn
Last name: Thomas

Re: auto delete or clean

#4 Post by TheShawnThomas » 2010-06-11 14:01

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 :)

User avatar
boco
Contributor
Posts: 26930
Joined: 2006-05-01 03:28
Location: Germany

Re: auto delete or clean

#5 Post by boco » 2010-06-11 16:22

Just a note: The *.cmd file described in the previous post has to be run on the server itself, locally.
No support requests over PM! You will NOT get any reply!!!
FTP connection problems? Please read Network Configuration.
FileZilla connection test: https://filezilla-project.org/conntest.php
FileZilla Pro support: https://customerforum.fileZilla-project.org

Xplasma
500 Command not understood
Posts: 5
Joined: 2010-08-01 00:21
First name: John
Last name: Torres

Re: auto delete or clean

#6 Post by Xplasma » 2010-08-01 00:41

hblevins wrote:I've had the same question, any luck?
Me too.

TheShawnThomas
500 Command not understood
Posts: 5
Joined: 2010-05-22 18:22
First name: Shawn
Last name: Thomas

Re: auto delete or clean

#7 Post by TheShawnThomas » 2010-10-31 03:34

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. :)

nitairoy
500 Command not understood
Posts: 3
Joined: 2013-12-24 10:18
First name: nitai
Last name: roy
Location: Dinajpur, Dhaka, Bangladesh

Re: auto delete or clean

#8 Post by nitairoy » 2013-12-24 10:37

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.

fionka3
500 Command not understood
Posts: 1
Joined: 2014-06-28 10:50
First name: Fionka
Last name: Małowska

Re: auto delete or clean

#9 Post by fionka3 » 2014-06-28 10:52

Auto delete? Where is this function?

User avatar
boco
Contributor
Posts: 26930
Joined: 2006-05-01 03:28
Location: Germany

Re: auto delete or clean

#10 Post by boco » 2014-06-28 13:14

FileZilla products do not support auto delete. This thread discusses an external solution.
No support requests over PM! You will NOT get any reply!!!
FTP connection problems? Please read Network Configuration.
FileZilla connection test: https://filezilla-project.org/conntest.php
FileZilla Pro support: https://customerforum.fileZilla-project.org

zillawallace
504 Command not implemented
Posts: 10
Joined: 2015-02-27 10:34
First name: Dean
Last name: Wallace

Re: auto delete or clean

#11 Post by zillawallace » 2015-04-17 13:38

interesting..I'll have to take a look later

Post Reply