Rubriques
How do I restart a failed script?
To restart a script previously failed, you just have to rerun it.
It will restart from the last failed step.
To force the restart from the first stop, you can use --fromscratch
parameter from command line, or restart from a specific step using --fromstep
parameter
My script is launched by a scheduler (or crontab), how can I know if it's running or not?
You can use the --status
parameter from command line.
./example1.sh --status
example1 status [STOPPED]
./example5.sh --status
example5 status [RUNNING][/quote]
How do I kill a running script?
To kill a script you can use the --kill
parameter from command line
./example5.sh --kill
[2017/12/20 09:30:28] Killing PID 10140
Why do the script exit with an error?
If a command launched in the script exit with an exit status different than 0 ($?), DjeShellSteps will end with this error code.
To avoid this, you can change use the true
command using || true
Replace:
ls /tmsd
By:
ls /tmsd || true
By this way, the script will continue without any error.
How can I display a specific help message from command line?
To add a specific help message from command line, you just have to fill the Help variable inside your script.
Example:
Help="<input>;Input file name|<output>;Output file name"
Will display a specific help when using --help
parameter
$./my_script.sh --help
./my_script.sh (powered by DjeShellSteps v1.01)
(c) Jerome DESMOULINS
Usage:
./my_script.sh <input> <output>
Where:
<input> Input file name
<output> Output file name
...
...