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 Answer
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.
-
So, my script works, but it doesn't work when I reboot.Seth Temple– Seth Temple2024-05-31 23:51:41 +00:00Commented May 31, 2024 at 23:51
-
Nevermind! It just... didn't work the first time?Seth Temple– Seth Temple2024-05-31 23:55:53 +00:00Commented May 31, 2024 at 23:55