forked from argilla/tools
Merge pull request 'backup script draft' (#1) from argilla/tools:master into master
Reviewed-on: #1
This commit is contained in:
commit
b719d01ad7
|
@ -0,0 +1 @@
|
|||
env
|
|
@ -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
|
||||
|
||||
|
|
@ -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```
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
REPO_DOCKER_PATH=/home/golem/docker
|
||||
BACKUP_PATH=/home/golem/backup
|
Loading…
Reference in New Issue