This question was asked nearly 6 years ago, and remains a relevant question. However - the ***[accepted answer](https://raspberrypi.stackexchange.com/a/28200/83790) is no longer relevant*** because `rc.local` has been deprecated. 

There are (*at least*) two alternatives to `rc.local` that - as of this date - are valid and supported:

1. `systemd` 

2. `cron` 

In comparison, `cron` is simpler, `systemd` is more *precise*. In general, either one will work for most requirements.