View unanswered posts    View active topics

All times are UTC - 6 hours





Post new topic Reply to topic  [ 12 posts ] 
Print view Previous topic   Next topic  
Author Message
Search for:
PostPosted: Sun Mar 12, 2006 3:55 pm 
Offline
Joined: Sat Feb 18, 2006 7:41 pm
Posts: 8
I've been searching for this and I'm sure it must be somewhere in this forum, but I can't find it -
I want to have my TV recordings stored on a 120GB drive in /myth/tv and, when that fills up, stored on a 320GB drive also (perhaps symbolically linked as /myth/tv2). I would like this to happen automatically, rather than noticing I'm full on the 120GB drive and then moving the files to the 320GB. Any suggestions?


Top
 Profile  
 
 Post subject:
PostPosted: Sun Mar 12, 2006 5:42 pm 
Offline
Joined: Mon Oct 06, 2003 10:38 am
Posts: 4978
Location: Nashville, TN
your best option would be LVM there is a howto on the wiki.

_________________
Have a question search the forum and have a look at the KnoppMythWiki.

Xsecrets


Top
 Profile  
 
 Post subject:
PostPosted: Sun Mar 12, 2006 9:31 pm 
Offline
Joined: Tue Feb 21, 2006 7:24 am
Posts: 396
Location: Dushanbe, Tajikistan
you could also put a simple script in your crontab that runs at say 3 am.

It would do a check on /myth/tv2 to check avail space.
If its below say 95%, it would move all the files over from the /myth/tv
directory to /myth/tv2 (except for most recent set, to avoid moving a file that might
still be open) and create sym links for them.

Once utilization exceeds 95% on /myth/tv2 the script would stop moving files and
you would start to fill up your /myth/tv directory.

I don't know if mythtv follows sym links when it deletes show, If it just deletes the
link and not the file... well then it gets a little ugly.

Isn't linux a joy ;)


Last edited by mac on Sun Mar 12, 2006 9:58 pm, edited 2 times in total.


Top
 Profile  
 
 Post subject: great idea
PostPosted: Sun Mar 12, 2006 9:41 pm 
Offline
Joined: Sat Feb 18, 2006 7:41 pm
Posts: 8
That's actually a great idea. I know very little about shell scripting, but I should be able to pull it off.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Mar 12, 2006 9:54 pm 
Offline
Joined: Tue Feb 21, 2006 7:24 am
Posts: 396
Location: Dushanbe, Tajikistan
Also -- I would do it in perl, as the script would be quite small..
I edited my above post -- You should do a few test first:

-) Create a sym link in /myth/tv for a show. Delete it with the frontend and see if
it followed the sym link and deleted the file of just deleted the link.

If it just deleted link and not the file. You would also have the script remove
files in /myth/tv2 that don't have link in /myth/tv.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 13, 2006 7:13 pm 
Offline
Joined: Tue Feb 21, 2006 7:24 am
Posts: 396
Location: Dushanbe, Tajikistan
There is a setting in mythtv-setup -> general
to follow sym-links when deleting files..


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 14, 2006 12:53 am 
Offline
Joined: Tue Jan 18, 2005 2:07 am
Posts: 1532
Location: California
Just out of curiosity, why not use LVM? I've been using it for quite a while now and it works well for me. It essentially takes multiple drives and makes them look like 1 single, large drive...

Marc


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 14, 2006 7:29 am 
Offline
Joined: Tue Apr 13, 2004 6:51 pm
Posts: 890
Location: Groton, MA
Quote:
Just out of curiosity, why not use LVM? I've been using it for quite a while now and it works well for me. It essentially takes multiple drives and makes them look like 1 single, large drive...



Same here!

_________________
R5F1 - Dell P4 2.4Ghz 500MB - PVR250 x 2 - GeForce FX 5200 - Onboard sound/NIC 80GB ATA/250GB ATA/400GB SATA


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 14, 2006 8:30 am 
Offline
Joined: Tue Nov 08, 2005 7:31 am
Posts: 195
Location: Secret Lair
LVM rocks.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 14, 2006 10:05 am 
Offline
Joined: Tue Feb 21, 2006 7:24 am
Posts: 396
Location: Dushanbe, Tajikistan
Nothing against LVM, it is really cool. For about anything I have a tendency to look at the
alternatives and then weigh the pro and cons..

pro:
LVM -- cool, expandable
Script -- fast and easy setup

con:
LVM -- crash recovery a bit of a hassle, > time to implement, I don't have any way to add extra
drives to my system anyway.

Script -- clunky, lots of extra IO

don't know.. it would be tough call for me ;)


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 14, 2006 10:21 am 
Offline
Joined: Sat Feb 18, 2006 7:41 pm
Posts: 8
LVM seems very cool, but I probably won't use it until I'm sure I have a good backup system in place.

The script is not the kind of solution I was hoping for, but I think I'll go with it. The main problem is figuring out when to move data to the bigger drive and when to stop (I can probably wait till the drive's 99% full rather than 95% but do I risk losing some data or wasting space?)

I'll post the script here when I'm done, which may be a while from now...I've got bigger fish to fry for the next few weeks and another side project (trying to get DSL on an old Powerbook that has no CDROM).


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 14, 2006 6:59 pm 
Offline
Joined: Tue Feb 21, 2006 7:24 am
Posts: 396
Location: Dushanbe, Tajikistan
the mv command won't delete the orginal if the copy to new location fails for some reason.
As for wasting space, just compare the file you are about to move to avail space before moving it.

$aspace = `df /myth/tv2 |awk '{print \$4}'|tail -1`;
$fsize = `ls -l /myth/tv/big.nuv |awk '{print \$4}'`;

Another con that I thought of regarding script method would be that mythtv would
misreport the the amount of avail space.. not a big deal, just another thing to consider.


Top
 Profile  
 

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 12 posts ] 


All times are UTC - 6 hours




Who is online

Users browsing this forum: No registered users and 22 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group

Theme Created By ceyhansuyu