Can't figure out how to set up autostart?

I have installed dietpi successfully and I would like to run the command “sh /root/” automatically when the pi is turned on. currently contains one line, “mkdir /root/testdir”, just to test that it works.

I have tried typing “sudo dietpi-autostart”, which opens the auto start window. I selected Custom: /etc/dietpi/ The screen cleared for a second, no text, then back to the DietPi-AutoStart menu. I exited. I then ran “sudo nano /etc/dietpi/”, and in that file I have “sh /root/”. I Ctrl-O, Ctrl-X’d and rebooted. I logged in, then tried “ls”, and I don’t have the testdir folder. Ideas?

I found a dirty solution by adding the line “/bin/sh /root/ &” to the file “/DietPi/dietpi/boot”.

Not the best solution as the boot file could be updated and your startup script then wouldn’t run.

Cron will do the job - there are many tutorials on this such as:

Skip the bit on gnome-schedule and concentrate on crontab -e.


does any changes occur to /etc/rc.local?