mikedpitt420

Members
  • Posts

    390
  • Joined

  • Last visited

Everything posted by mikedpitt420

  1. I am trying to make a script that will run in cron once per week at 630AM once per week that looks at several folders and deletes anything older than either 1 week or 1 month. I also understand that I have to add the to my go script so it can persist after reboot. I know this is going to sound like a very dumb question, but I am trying to write the script and I just want someone to make sure it's correct before I change anything. This is what I have so far: file is named /boot/config/cronshowautodelete #!/bin/bash find /mnt/user/media/TV Shows/Law & Order Special Victims Unit/* -type d -ctime +30 -exec rm -rf {} \; find /mnt/user/media/TV Shows/CSI Crime Scene Investigation/* -type d -ctime +30 -exec rm -rf {} \; find /mnt/user/media/TV Shows/Parks and Recreation/* -type d -ctime +30 -exec rm -rf {} \; find /mnt/user/media/TV Shows/Community/* -type d -ctime +30 -exec rm -rf {} \; find /mnt/user/media/TV Shows/Real Time with Bill Maher/* -type d -ctime +30 -exec rm -rf {} \; find /mnt/user/media/TV Shows/The Colbert Report/* -type d -ctime +7 -exec rm -rf {} \; find /mnt/user/media/TV Shows/The Daily Show with John Stewart/* -type d -ctime +7 -exec rm -rf {} \; I guess my 4 questions are: 1. Is the script above OK with the current spacing in the directory names? And this will also delete all files and directories in this path recursively? This will be my first script, apologies for my ignorance. 2. How do I make this a cron job for the above mentioned time? 3. How do I add this to the go script for persistence? 4. Would anyone be interested in implementing an addon that can be handled through the webGUI that allows you to pick directory names and how much time to keep them with drop downs or something so it's extremely easy? Maybe with a few other options or rules as well? I'm not "completely" new to linux and I've always been able to muddle my way through, and unRAID has been a blessing for me. I have a home server that is functioning really well, and was very easy to configure and install thanks to the webGUI. The more options you can have for things like this, the more popular unRAID will get. Thanks for all the awesome work this community is doing! I'm going to preach unRAID from high on the mountain!