Start a new topic

Send Email with List of Files/Then Delete files

maryellen.mealey @ Tue Jan 13 17:46:52 EET 2015
Hey -
I'm looking to perform a specific set of actions for one of my FTP accounts on my sever.

Basically, I want to Send an email to Susie User to let her know that on the FTP site in her account there are XXX files and show her the file list.
She then has 2 days to keep what she wants.
After the 2 days are up - the action will run that will delete (or archive) the files in that that are older than XX days.

I know how to do the delete part.

What i haven't figure out yet is how to do the first part -that is create the file list -

THanks very much

spinkb @ Tue Jan 13 18:48:03 EET 2015
I think for your scenario, you just need to use a Folder Monitor to find the files that are older than a certain date...

But the issue is that folder monitor is going to find files every minute that are older...

So on your first find, you need to move them into a sub folder, like "_TO_BE_DELETED".

Then only scan that sub folder for files older than 32 days or 92 days, etc...2 days more. So they can move them out of there...

But CrushFTP always sees the modified date. So if they are being moved out of there, you are going to need to "touch" the file to make it be modified with todays date. Otherwise you put it back in the main folder, folder monitor grabs it and puts it in the to be deleted folder, then it checks that folder and deletes it instantly as the file is now old enough...

So its a combination of moving the file, resetting its date, and the can move it back to the main folder.

This is just two task steps in CrushFTP being called by folder monitor.
Rename (and set to todays date flag), then move to _TO_BE_DELETED

Then a separate folder monitor to find files older than 2 days in that folder it was moved to. (_TO_BE_DELETED)

Thanks,
Ben
maryellen.mealey @ Wed Jan 14 09:08:18 EET 2015
The folder monitor will serve the purpose for finding the files older than XX. I like the suggestion of moving them to a different folder... that might work as well

Is there an additional action that can be used to send an email to someone to remind them to check the files prior to deletion?

thanks much
spinkb @ Wed Jan 14 09:43:40 EET 2015
You said its only one user...so put this all in the CrushTask.

Your only using FolderMonitor to run a crush task, folder monitor is not going to do anything else.

FolderMonitor finds files older than 90 days.
CrushTask: Rename (same name, just update modified date)
Move: put files in subfolder
Email: email person their are files about to be purged.

FolderMonitor finds files older then 4 days in the subfolder
Email: email person their files have been deleted
Delete: files

--Ben

Looking to do the same thing but I am unfamiliar with how I get this working. 


I want to monitor my entire FTP however I have a folder structure for each client and I only want the files and folders that are a specific depth to get checked for older then x then an email list of those files goes out saying they are x days old ( once a day) and they will be deleted after they are x old. Then another task that would perform that delete operation. I had an apple script that does this but it is not performing as expected.

This is sounding rather custom and complex...not the straight forward find old files and delete them...


If you have an enterprise license, this can be done via Jobs, and even then the whole depth part of this makes it a bit challenging...  You can find items in a  path, and recursively find deeper.  Then you can exclude items matching a pattern with the URL that references them.


A FindCache can be used to prevent re-finding the files that are in-between warning and expiration.  Finally the expiration task can find the stuff matching its scenario...


So I think its all possible, but its not straight forward or custom, its not something the folder monitor feature is going to be able to solve unfortunately.

Login to post a comment