5

I would like to create an online painter web app.

The app would allow users to draw anything they like and save their drawings on the server.

However, many "guest" users may just come and draw some random strokes then never use those randomly-made drawings.

But I have to kept the files because some user may want to get their drawings a few days later.

So is it possible to set a logic for A

1 Answer 1

3

You can't do this natively in AWS EFS. You can move it to cheaper storage natively in EFS by setting up Lifecycle Management to move the files last accessed X days ago to Infrequently Accessed (IA) EFS storage. This will reduce your storage cost but not eliminate them. This feature will also move the file back if they are accessed. See the reference below for more details.

You could run a command like the find below to find files not accessed for 30 days and delete them. NOTE: this will take up a lot of CPU cycles depending on the amount of files in the path. YMMV.

find /path/to/efs/* -atime +30 -exec rm {} \;

References
EFS Infrequent Access
Finding Files by Access Modification Date/Time

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.