⚗️ add redis backup script

This commit is contained in:
yanyongyu 2021-03-25 16:44:11 +08:00
parent ab76dd11b6
commit 27147ecb48
4 changed files with 13 additions and 1 deletions

View File

@ -12,7 +12,7 @@ RUN poetry export --without-hashes -f requirements.txt \
&& poetry run playwright install \
&& poetry install --no-dev
COPY ./download_wkhtmltox.sh /app/
COPY ./scripts/download_wkhtmltox.sh /app/
RUN echo "deb http://mirrors.aliyun.com/debian/ buster main contrib non-free" >> /etc/apt/sources.list\
&& echo "deb http://mirrors.aliyun.com/debian/ buster-updates main contrib non-free" >> /etc/apt/sources.list\

View File

@ -32,6 +32,7 @@ services:
- redis
depends_on:
- redis
restart: always
networks:
bot_net: {}
volumes:

11
scripts/backup_redis.sh Normal file
View File

@ -0,0 +1,11 @@
#!/bin/bash
###
# @Author : yanyongyu
# @Date : 2021-03-25 16:22:18
# @LastEditors : yanyongyu
# @LastEditTime : 2021-03-25 16:42:58
# @Description : None
# @GitHub : https://github.com/yanyongyu
###
docker run --rm --volumes-from $(docker-compose config --volumes) -v $(pwd):/backup busybox tar cvf /backup/backup-$(date +"%s").tar /data