docs: More help/usage

This commit is contained in:
Patrick MARIE 2024-10-08 21:33:32 +02:00
parent c115babaca
commit 3c52c40250
Signed by: mycroft
GPG Key ID: BB519E5CD8E7BFA7
2 changed files with 34 additions and 3 deletions

View File

@ -9,7 +9,24 @@ The included workflow that actually performs the backup can be manually run thro
## Usage
```sh
$ /bin/bash scripts/backup.sh -r <repository> -b <branch> -d </path/to/data> [-n <commit limit>] [-v] [-x]
$ scripts/backup.sh -h
Usage: scripts/backup.sh [-r <repository url>] [-b <branch>] [-d <path dest>] [-n <num>] [-v] [-x] [-i] [-h]
Ex: scripts/backup.sh \
-r https://github.com/descartes-underwriting/devops-technical-test-data.git \
-b main \
-d /home/mycroft/dev/private-backup/data
Available flags:
-r <repository url> - set remote repository url (suffixed by .git) to backup
-b <branch> - branch to backup
-d </path/to/path> - where to backup; relative or absolute
-n <num> - number of commit to backup (default: unlimited)
-i - ignore tracking information - to restart from scratch
-v - verbose mode
-x - debug mode
-h - this help
```
Ex:

18
scripts/backup.sh Normal file → Executable file
View File

@ -45,8 +45,22 @@ do
set -x
;;
h)
echo "Usage: $0 [-r <repository url>] [-b <branch>] [-d <absolute path dest>] [-n <num>] [-v] [-x] [-h]"
echo "Ex: $0 -r $REPOSITORY -b $BRANCH -d $DATA_DIR"
echo "Usage: $0 [-r <repository url>] [-b <branch>] [-d <path dest>] [-n <num>] [-v] [-x] [-i] [-h]"
echo
echo "Ex: $0 \\"
echo " -r $REPOSITORY \\"
echo " -b $BRANCH \\"
echo " -d $DATA_DIR"
echo
echo "Available flags:"
echo " -r <repository url> - set remote repository url (suffixed by .git) to backup"
echo " -b <branch> - branch to backup"
echo " -d </path/to/path> - where to backup; relative or absolute"
echo " -n <num> - number of commit to backup (default: unlimited)"
echo " -i - ignore tracking information - to restart from scratch"
echo " -v - verbose mode"
echo " -x - debug mode"
echo " -h - this help"
exit 0
;;
?)