Friday, December 23, 2011

Eject.

Hi

Last week my friend log into my laptop through the network and opens
my CD ROM. Fortunately i catch him by his face expressions.
However i try to find out the command for it. mmmm.. got it.
(Thanks for google.)

I just need to type "eject".  [I'm working in Fedora ver 13 ;)] 
Even no need to be the root.

OK.. Then i thought more things to give the RETURN. 
ah.. Previously i red (November 8 in 2009 blog entry) 
about cron jobs in Linux. But i never used it.

i wrote 

#!/bin/sh
eject

in a file and save it as "eject.sh".
Make it executable.
> chmod +x eject.sh

Then wrote 

* * * * * /home/kumudu/eject.sh

in another file and save it as "execute.cron". 

(Note : This says the eject.sh will trigger in every minute.)

Finally i need to set this cron job 

> crontab /execute.cron

:D You know what would be the result...

Unfortunately he has blocked port 22. :(
port 22: No route to host

Need to think more.....

> crontab -l      : Gives current crons
> crontab -e      : Can edit the current cron.
> crontab -r      : Remove the current cron.

Use man crontab for more details.
 
Cron expression.
[min] [hour] [day of month] [month] [day of week] [program to be run]