PDA

View Full Version : [all variants] Running a script on CD insert?


logical_thought
June 13th, 2008, 03:50 PM
I'm trying to get a script to run whenever a cd is inserted, but I don't know how. I figured out how to get it to work with gnome, but I need to find a way to get this to work on a headless server when no one is logged in.

So far I've tried setting up my script in cron. I install autofs and told my script to try and access the cdrom every few minutes, which works on the first cd...but then it keeps accessing the same disk.

I would like to find a way to have the script run one time (instead of with cron) when the cd is inserted and then it ejects.

PS. Sorry if I posted this in the wrong place, I wasn't sure where this fit.

windependence
June 14th, 2008, 02:09 AM
Why are you wanting to do this?

-Tim

logical_thought
June 14th, 2008, 09:15 AM
Why are you wanting to do this?

-Tim
I make a lot of dvds and would like to back them up directly to my backup server instead of making the backup on my desktop and uploading them.

They are all dvds that I have made (home movies, trips, etc...)

logical_thought
June 14th, 2008, 04:28 PM
Thinking on it now....all I really need is the cd to automount when it is inserted.

logical_thought
June 22nd, 2008, 01:13 AM
I solved this custom daemon, but I would still like to know if there is a built in (or easier) method.