This document explains how to configure the bkp.sh
backup script to be executable from the command line.
The script requires an env.json
file to function properly. This file can be created by copying the existing example_env.json
file. Follow these steps:
-
Open a terminal in the directory where the
bkp.sh
script is located. -
Ensure the
example_env.json
file is present in the same directory as thebkp.sh
script. -
Create the
env.json
file by copyingexample_env.json
:cp example_env.json env.json
This will create a new file named
env.json
based on the contents ofexample_env.json
. -
Edit the
env.json
file as needed to include the necessary environment variables or configurations required by the script. You can use any text editor to modify this file.
To make the bkp.sh
script executable from the command line, you'll need to change the file permissions. Follow these steps:
-
Change the file permissions to make it executable by running the following command:
chmod +x bkp.sh
-
The script is now ready to be executed. You can run it directly from the terminal with:
./bkp.sh
If you want to be able to run the script from any directory, you can add the directory containing the script to your PATH
. To do this:
-
Open your shell configuration file (e.g.,
~/.bashrc
,~/.bash_profile
, or~/.zshrc
). -
Add the following line to the end of the file:
export PATH=$PATH:/path/to/script/directory
Replace
/path/to/script/directory
with the actual path to the directory wherebkp.sh
is located. -
Update your shell environment to apply the changes:
source ~/.bashrc
or
source ~/.bash_profile
-
You can now run the script from any directory by simply typing:
bkp.sh
To execute the bkp.sh
script, type:
./bkp.sh