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
.git
as ingithub
in the clouds?/usr/local/bin
. Otherwise, I would say just put them in~/bin
. Your own scripts in both directories should be safe when you upgrade.~/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
.