run command line at startup

Asked by Bill Lancaster on 2011-02-20

I run this command every day at startup:-

get_iplayer --listformat="<pid>|<name>|<index>" --type=radio --nocopyright >radio-index

I modified /etc/rc.local by adding the following line:-

/usr/bin/perl /usr/bin/get_iplayer --listformat="<pid>|<name>|<index>" --type=radio --nocopyright >radio-index

but nothing happens when I reboot. I believe get_iplayer needs an internet connection but this should be established when rc.local runs.

Please help

Bill Lancaster

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu bash Edit question
Assignee:
No assignee Edit question
Solved by:
Bill Lancaster
Solved:
2011-02-21
Last query:
2011-02-21
Last reply:
2011-02-20

make a script and add it in your users startup. As you are running it in the desktop without sudo, it is running as user. /etc/rc.local commands run as root.

If you add the item in your startup it will run at login and you will have a net connection. You may want to add:

sleep 15

So the system has time to get connected before the command runs.

Thanks - it worked, didn't need sleep 15 either