Merge pull request 'backup script draft' (#1) from argilla/tools:master into master

Reviewed-on: #1
This commit is contained in:
gbiotti 2020-12-11 22:41:34 +00:00
commit b719d01ad7
4 changed files with 47 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
env

30
argilla Executable file
View File

@ -0,0 +1,30 @@
#!/bin/bash
source ./env
NOW=$(date +'%Y-%m-%d-%H-%M-%S')
case $1 in
# argilla project $name backup
project)
case $3 in
backup)
docker-compose -f $REPO_DOCKER_PATH/$2/docker-compose.yml down
tar cf $BACKUP_PATH/$2-$NOW.tar.gz /srv/$2
docker-compose -f $REPO_DOCKER_PATH/$2/docker-compose.yml up -d
;;
*)
echo "bad command"
exit 1
;;
esac
;;
*)
echo "bad parameter"
exit 1
;;
esac
exit 0

14
argilla.md Normal file
View File

@ -0,0 +1,14 @@
# argilla
```
./argilla [ arg1 arg2 ... argN ]
```
# Env Variables
Put them in ./env, it will be loaded by argilla script.
* ```BACKUP_PATH``` path to directory for backups
* ```REPO_DOCKER_PATH``` path to docker scripts repository
# Usage
```sudo ./argilla project $name backup```

2
env.example Normal file
View File

@ -0,0 +1,2 @@
REPO_DOCKER_PATH=/home/golem/docker
BACKUP_PATH=/home/golem/backup