LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Script to delete files on schedule (https://www.linuxquestions.org/questions/linux-newbie-8/script-to-delete-files-on-schedule-4175477375/)

larrybg 09-16-2013 07:50 PM

Script to delete files on schedule
 
Hi everyone,
Please help - I need a script that will run on schedule and delete folders and files from the NAS drive older than X days.

Thanks

TB0ne 09-16-2013 08:47 PM

Quote:

Originally Posted by larrybg (Post 5028851)
Hi everyone,
Please help - I need a script that will run on schedule and delete folders and files from the NAS drive older than X days.
Thanks

Ok..we'll be glad to help you, but we will NOT write your scripts for you. There are many easily-found bash scripting tutorials; start there. Post what you've written/tried, and tell us where you're stuck.

Otherwise, read the man page on the find command, and pay particular attention to the ctime/mtime parameters.

J.A.X 09-16-2013 08:59 PM

Hi there,

You may want to look at the man pages for cron.

Write a script to remove the X days old files, cron daemon will run the script for you at a specific time.

http://en.wikipedia.org/wiki/Cron

I hope this helped :)


All times are GMT -5. The time now is 02:54 AM.