What's new

Automatically delete files after X days?

rstark18

Occasional Visitor
Is it possible to automatically delete files in a Shared Folder after a certain amount of days? I have a folder that gets security camera stills and video. I want that folder to delete any files older than X number of days. Can Task Scheduler be used with a script maybe? Can anyone think of a way to do this natively? I know I can use my PC backup program (SyncBack) to do it but would rather have it done on the NAS.
 
I was hoping for a simpler way. I haven't found any examples of using logrotate to manage files other than log files.
 
One could do a crontab entry to sweep the files, but that'll wipe the entire directory.

The other approach would be a shell script based on file system time stamps, and then write than into a crontab.

Sorry - not really a simple way without doing some kind of shell scripting for automation.
 

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!

Members online

Back
Top