0

I have essentially zero knowledge about this. My problem is that I can't find information about how to add a script on startup of a Oracle Linux Virtual Machine- only on one running ubuntu. How would I do this?

1
  • Just to clarify, my script i need to run is just a minecraft server launch script Commented May 31, 2024 at 22:56

1 Answer 1

0

The easiest way would be to add that script to the cron table of the user whom you wish to be in control of the script. For example, if the user exampleuser owns the script, log in as that user and run crontab -e to edit the cron table, and add an entry such as:

@reboot /bin/bash /home/exampleuser/my_nifty_script.sh >> /home/exampleuser/my_nifty_script.log 2>> /home/exampleuser/my_nifty_script.err

This will run the script at system startup, and capture any output or error messages into separate files.

2
  • So, my script works, but it doesn't work when I reboot. Commented May 31, 2024 at 23:51
  • Nevermind! It just... didn't work the first time? Commented May 31, 2024 at 23:55

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.