I have a few very simple Bash scripts that I cobbled together for things that I do regularly.
One of them is to run duplicity to do my backup tasks. Nothing clever, just a bunch of if .. then
statements really.
As this needs to be run as root, would it be best practice to put my script in /usr/bin
(or another location on PATH), chown
to root:root and chmod
to 700?
git
to version-control your scripts, put local copies of the git repos somewhere you like in~
, and then symlink the scripts into~/bin
. – edwinksl Sep 26 '16 at 23:20git
as ingithub
in the clouds? – WinEunuuchs2Unix Sep 26 '16 at 23:21git
(on your machine only) not remote ones like those ongithub
. This latter would only be useful if you wanted to share your scripts with others. – IanC Sep 26 '16 at 23:26git
is anything likegithub
I feel overwhelmed thinking about the learning curve. – WinEunuuchs2Unix Sep 26 '16 at 23:37/home/me/bin
is remembering to get new user accounts permission to the directory and putting it in their path. Is there a disadvantage to/usr/local
like it goes poof when an upgrade is done? – WinEunuuchs2Unix Sep 26 '16 at 23:41/usr/local/bin
. Otherwise, I would say just put them in~/bin
. Your own scripts in both directories should be safe when you upgrade. – edwinksl Sep 26 '16 at 23:43~/bin
is dynamically placed in PATH$ during login. – WinEunuuchs2Unix Sep 27 '16 at 00:16~/bin
is the best place for most scripts as you don't have to usesudo
to edit them as you do when they are stored in/usr/local/bin
. – WinEunuuchs2Unix Aug 20 '17 at 01:07