如何在Ubuntu-touch上自动启动shell脚本?

每当我打开手机以通过syncevolution与我自己的云服务器同步我的日历和联系人时,我想在我的bq Aquaris E4.5 Ubuntu-Edition上启动一个shell脚本。

如何自动启动我的shell脚本? 它需要crontab条目还是有更简单的选择?

以下是我的/ home / phablet / Documents文件夹中的示例脚本:

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

可能有更好的方法,但您可以在/ usr / share / upstart / sessions /中创建一个upstart脚本,名为evolutionsync.conf

 description "my script" start on started unity8-dash exec /path/to/your/script 

这将基本上在桌面启动后运行,并且您会看到“主屏幕”(应用程序菜单和范围等)。