Looking for a way to delete last week's episodes
#1
Is there a way that I can auto delete last week's episodes for shows that are aired daily?

So for example, on every sunday, the last week's shows are deleted. Is there anything like this out there?
Reply
#2
If you are on xbmc-live or linux you can touch all your files after recording/downloading, and delete them on sunday with
Code:
find /path/to/show -name "*.mkv" -type f -mtime +7 -exec rm {} \;
Reply
#3
If you are on Windows you can use a VB script run from the task scheduler. This is what I use:

Code:
Sub processFolder(ByRef folder, ByVal path)
  For Each file In folder.Files
    If DateDiff("d",file.datelastmodified,Date) > 6 Then
     file.Delete
    End If
  Next
  For Each subfolder In folder.SubFolders
    processFolder subfolder, path&"/"&folder.Name
  Next
End Sub
processFolder CreateObject("Scripting.FileSystemObject").GetFolder(WScript.Arguments(0)), WScript.Arguments(0)

Just save it as .vbs and then open the task scheduler and create a new task (NOT a basic task). Set up the schedule you want to use, then on the actions tab you want to use the path to this script as the program to launch, and then put the path to the folder you want processed in the Arguments field.

Note that this scans and deletes recursively and does not provide any warning or confirmations. Be very careful with this code or you are going to delete a LOT of stuff that you may not want deleted.

There are a lot of other ways to do this as well. Python is a great way to accomplish this if you have it installed and are comfortable with it. You can use a PowerShell script (which would be an even smaller script). For lots more ideas and examples try this:

http://lmgtfy.com/?q=delete+files+older+than+x+days
Reply
#4
You could also use a program called Belvedere to do this. It can monitor any number of folders and delete files that are a certain age. It, in fact, can do much more than that.

Mark
Reply

Logout Mark Read Team Forum Stats Members Help
Looking for a way to delete last week's episodes0