Where to place my scripts?

Hello everyone!

What would be the correct directory to store a script.sh file that I would like to run on the startup as well as periodically with cron. The script itself downloads some info from the remote and adjusts configuration based on that info.

You can put the script in several places... /usr/bin is a common place, or /root/ is another. As long as you give it execute permissions and reference the script using its complete path, it should work from wherever you put it.

For boot-time execution, add it to your /etc/rc.local file.

Don't forget to also add it to /etc/sysupgrade.conf if you want it to be backed up as part of your normal system backup.

2 Likes

Thank you Peter!

I've been using /root/bin/, where I just hack any old thing that I happen to be experimenting with, then echo /root/bin >> /etc/sysupgrade.conf so it all gets backed up and carried over on upgrades.

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.