I got myself a minecraft server that turns on and off on specific hours but I don't want to type the commands every time it should start playing and let it run those commands after boot. I found an old askubuntu thread (for 12.04) where this is handled and let it run as root. But for security reasons, I don't want it to run as root. I would like to still be able to type in commands to like stop the server, so it cannot run my bash script somewhere hidden.
Asked
Active
Viewed 96 times
2 Answers
1
You could try to use a crontab entry for your user.
The command to run a command att boot is "@reboot".
Example of crontab entry:
@reboot cd /home && sh ./myscript.sh
Level9
- 357
0
To automatically run a command every time the system boots:
Search "Startup Applications" in the dash and open it.
Click add. For the name put "Start Minecraft Server" and under "command" put your command used to start your Minecraft server.
Press add and now the script should run on restart/startup.
Enjoy!
jackw11111
- 794