SageTV Community  

Go Back   SageTV Community > SageTV Development and Customizations > SageTV v7 Customizations
Forum Rules FAQs Community Downloads Today's Posts Search

Notices

SageTV v7 Customizations This forums is for discussing and sharing user-created modifications for the SageTV version 7 application created by using the SageTV Studio or through the use of external plugins. Use this forum to discuss plugins for SageTV version 7 and newer.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 04-20-2011, 08:31 PM
heffneil heffneil is offline
Sage Fanatic
 
Join Date: Feb 2008
Posts: 748
Recordings cleaning up

Guys,

I really need help cleaning up my recordings directory. I have a lot of orphaned files from stuff I was watching live. I believe the mpg file was deleted but the edl and other "stuff" still exists. Is there a simple batch script that works and cleaning up those files? I haven't installed the sage queue program because it is very overwhelming and that makes it cumbersome for the two tasks I need perform in regards to my recoding files.

If you have any tips or tricks up your sleeve please let me know!

Thanks!

Neil
Reply With Quote
  #2  
Old 04-20-2011, 08:52 PM
wrems's Avatar
wrems wrems is offline
Sage Icon
 
Join Date: Feb 2007
Location: Marietta, GA
Posts: 1,332
Are you using Tmiranda's integrated comskip? I believe in the config options in detailed setup there is a way to cleanup the orphaned files... From memory though.
Reply With Quote
  #3  
Old 04-20-2011, 09:02 PM
wrems's Avatar
wrems wrems is offline
Sage Icon
 
Join Date: Feb 2007
Location: Marietta, GA
Posts: 1,332
You could use Dirmon2 to maintain things too.
Reply With Quote
  #4  
Old 04-20-2011, 09:13 PM
heffneil heffneil is offline
Sage Fanatic
 
Join Date: Feb 2008
Posts: 748
There are clean up options but they don't appear to have ever worked. I recently moved my installation from Windows 2003 Server to Windows 7 and since doing so dirmon2 can not install itself as a service. I haven't gone through the trouble of registering it manually with srvany but considered it?
Reply With Quote
  #5  
Old 04-21-2011, 07:31 AM
razrsharpe razrsharpe is offline
Sage Icon
 
Join Date: Sep 2008
Location: Boston, MA
Posts: 2,111
i have the same problem and have been meaning to either find or write a little program to go through and purge orphaned files... i just haven't gotten there yet
__________________
Server 2003 r2 32bit, SageTV9 (finally!)
2x Dual HDHR (OTA), 1x HD-PVR (Comcast), 1x HDHR-3CC via SageDCT (Comcast)
2x HD300, 1x SageClient (Win10 Test/Development)
Check out TVExplorer
Reply With Quote
  #6  
Old 04-21-2011, 07:41 AM
heffneil heffneil is offline
Sage Fanatic
 
Join Date: Feb 2008
Posts: 748
We can't be the first people to be OCD enough to want to clean that directory up. I figured someone must have a script or something that finds .ts or .mpg files and if don't exists deletes the files with the same name before the period. I have seen guys write something like this in linux in the shell. Its like for every fille in the directory look for .mpg or .ts and if it isn't found delete it?

Neil
Reply With Quote
  #7  
Old 04-21-2011, 08:19 AM
vividweb vividweb is offline
Sage Aficionado
 
Join Date: Aug 2006
Location: Calgary AB
Posts: 401
There is also Sage Artifact Delete http://forums.sagetv.com/forums/show...light=artifact but have not used it.
__________________

Sage Server: i5-2500K 8 GB DDR, 6000gb HDD, 4xHD-PVR < 4xBell 6141, Win7 x64
Client 1: HD-200, Panasonic 42PX75
Client 2: HD-300, Samsung LCD
Client 3: HD-300, Samsung PN50C550
Client 4: MS Surface Pro
Reply With Quote
  #8  
Old 04-21-2011, 08:41 AM
graywolf's Avatar
graywolf graywolf is offline
Sage Icon
 
Join Date: Oct 2009
Location: NC
Posts: 1,389
Quote:
Originally Posted by heffneil View Post
We can't be the first people to be OCD enough to want to clean that directory up. I figured someone must have a script or something that finds .ts or .mpg files and if don't exists deletes the files with the same name before the period. I have seen guys write something like this in linux in the shell. Its like for every fille in the directory look for .mpg or .ts and if it isn't found delete it?

Neil
here is quick/cheap/dirty (from memory). UNTESTED but should get you started.
Not sure how to do it for windows. Better at ksh scripts than windows bat.

Code:
#!/bin/ksh
SCRIPT_NAME=$0
CHECK_DIR=$1
LOG_FILE="cleanup.log"
cd ${CHECK_DIR}
echo `date` > ${LOG_FILE}

FILELIST=`ls * | grep -v "*.mpg" | grep -v "*.ts" | awk '{print $NF}'`

for SEARCH_FILE in ${FILELIST} ; do
   FILE_NAME=`echo ${SEARCH_FILE} | awk -F "." '{print $1}'`
   if [[ -f "${FILE_NAME}.mpg" || -f "${FILE_NAME}.ts" ]] ; then
      echo "${FILE_NAME} mpg or ts file exists" >> ${LOG_FILE}
   else
## rm command commented out until testing/verification is done
#      rm -f ${SEARCH_FILE}
      echo "deleted (or would have) ${SEARCH_FILE}" >> ${LOG_FILE}
   fi
done
exit
Reply With Quote
  #9  
Old 04-21-2011, 08:58 AM
razrsharpe razrsharpe is offline
Sage Icon
 
Join Date: Sep 2008
Location: Boston, MA
Posts: 2,111
Quote:
Originally Posted by vividweb View Post
There is also Sage Artifact Delete http://forums.sagetv.com/forums/show...light=artifact but have not used it.
going from memory here... but SAD works with the new event system... so it can be used for files that are newly deleted... but to clean up the older orphans it doesn't work.
__________________
Server 2003 r2 32bit, SageTV9 (finally!)
2x Dual HDHR (OTA), 1x HD-PVR (Comcast), 1x HDHR-3CC via SageDCT (Comcast)
2x HD300, 1x SageClient (Win10 Test/Development)
Check out TVExplorer
Reply With Quote
  #10  
Old 04-21-2011, 09:00 AM
nyplayer nyplayer is offline
SageTVaholic
 
Join Date: Sep 2005
Posts: 4,997
Quote:
Originally Posted by heffneil View Post
There are clean up options but they don't appear to have ever worked. I recently moved my installation from Windows 2003 Server to Windows 7 and since doing so dirmon2 can not install itself as a service. I haven't gone through the trouble of registering it manually with srvany but considered it?
You can run the hidden DIRMON2... setup the files to clean up... then run the Dirmon batch file. You will find it in programs Dirmon2.
__________________
Channels DVR UBUNTU Server 2 Primes 3 Connects TVE SageTV Docker with input from Channels DVR XMLTV and M3U VIA Opendct.
Reply With Quote
  #11  
Old 04-21-2011, 11:28 AM
gplasky's Avatar
gplasky gplasky is offline
SageTVaholic
 
Join Date: Jul 2003
Location: Howell, MI
Posts: 9,203
Yeah-I use Dirmon2 to run comskip and all my orphans get cleaned up with Dirmon2.

Gerry
__________________
Big Gerr
_______
Server - WHS 2011: Sage 7.1.9 - 1 x HD Prime and 2 x HDHomeRun - Intel Atom D525 1.6 GHz, Acer Easystore, RAM 4 GB, 4 x 2TB hotswap drives, 1 x 2TB USB ext Clients: 2 x PC Clients, 1 x HD300, 2 x HD-200, 1 x HD-100 DEV Client: Win 7 Ultimate 64 bit - AMD 64 x2 6000+, Gigabyte GA-MA790GP-DS4H MB, RAM 4GB, HD OS:500GB, DATA:1 x 500GB, Pace RGN STB.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
need help cleaning up server SageGk SageTV Software 0 12-05-2009 12:02 PM
Cleaning out old lineups and channels dooferlad SageTV EPG Service 2 07-05-2009 08:38 AM
Spring Cleaning Time lakeman SageTV Customizations 3 04-03-2009 11:45 AM
Cleaning up Snow Help ToyMaster458 Hardware Support 4 11-22-2006 10:02 AM
Cleaning up Harddrive ascv General Discussion 2 04-01-2005 07:47 AM


All times are GMT -6. The time now is 04:29 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, vBulletin Solutions Inc.
Copyright 2003-2005 SageTV, LLC. All rights reserved.