run command line at startup

Asked by Bill Lancaster

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:
Last query:
Last reply:
Revision history for this message
actionparsnip (andrew-woodhead666) said :
#1

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.

Revision history for this message
Bill Lancaster (bill-lancaster) said :
#2

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