hmm, that does look promising, though I think would do something like this instead
if `cat /dev/mtab | grep /dev/sr0` = true
umount /dev/sr0
mount /dev/sr0 /media/cddrive
cp -arv /media/cddrive/. /Archive
echo "The CD has finished copying"
umount /dev/sr0
end if
Though I'm not completely certain whether that if condition would actually work in bash as currently written. Now the only thing left to figure out is to get the script to automatically run whenever a disc is inserted. A possible solution would be polling mtab, but I'm not quite sure how to go about doing it. Also, some kind of gtk notification and ejecting the cd-rom tray when it's finished copying would be useful additions.
EDIT: Now this is weird, I tried that script without the if portion and things seemed to copy properly, except for the fact that all of the files copied had invalid encoding appended to the file name. Any ideas on why that happened?
Last edited by valunthar; 06-24-2011 at 05:48 PM.
|