What's new

Automatically delete files after X days?

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

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.
 
Similar threads
Thread starter Title Forum Replies Date
D How to recover lost files from Synology NAS DS415+ Synology 15

Similar threads

Latest threads

Sign Up For SNBForums Daily Digest

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