Ubuntu – How to autostart a shell script on Ubuntu-touch

autostartscriptsubuntu-touch

I want to start a shell script on my bq Aquaris E4.5 Ubuntu-Edition whenever I switch on the phone to syncronize my calendar and contacts via syncevolution with my owncloud server.

How can I autostart my shell script? Does it require a crontab entry or is there an easier option?

Here is the example script from my /home/phablet/Documents folder:

#!/bin/sh
# sync contacts and calendar with OwnCloud
syncevolution owncloud calendar-defaultcalendar
syncevolution --sync slow owncloud contacts
exit 0

Best Answer

There could be better ways, but you can create an upstart script in /usr/share/upstart/sessions/, called evolutionsync.conf

description "my script"
start on started unity8-dash 

exec /path/to/your/script

This will essentially run once the desktop has started and you see the "home screen" (apps menu and scopes etc.).

Related Question