mirror of
https://github.com/wassname/Open-Assistant.git
synced 2026-06-27 16:10:30 +08:00
added backup script
This commit is contained in:
@@ -7,3 +7,5 @@ RUN apt-get update && apt-get install -y unzip curl && rm -rf /var/lib/apt/lists
|
||||
RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
|
||||
RUN unzip -q awscliv2.zip
|
||||
RUN ./aws/install
|
||||
|
||||
COPY ./backup_pg_to_s3.sh .
|
||||
Executable
+13
@@ -0,0 +1,13 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
set -x
|
||||
|
||||
# filename with timestamp
|
||||
filename="postgres-$(date +%Y-%m-%d_%H-%M-%S).sql"
|
||||
|
||||
# perform pg_dump
|
||||
pg_dump -U postgres postgres > /tmp/$filename
|
||||
|
||||
# upload to s3
|
||||
aws s3 cp /tmp/$filename s3://$S3_BUCKET_NAME/$filename
|
||||
Reference in New Issue
Block a user