-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DBC22-2085: Backup Media and improve log handling
- Loading branch information
1 parent
95025ca
commit c9ec45a
Showing
35 changed files
with
721 additions
and
279 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
FROM alpine:3 | ||
RUN apk update && apk upgrade | ||
#Need goaccess 1.92 for a timezone fix. Once that version is in the regular branch, we can pull it from there. | ||
RUN apk add goaccess --repository=https://dl-cdn.alpinelinux.org/alpine/edge/main | ||
|
||
RUN apk add --no-cache \ | ||
aws-cli \ | ||
bash \ | ||
coreutils \ | ||
tzdata | ||
|
||
COPY ./compose/openshiftjobs/entrypoint.sh / | ||
COPY ./compose/openshiftjobs/scripts/analyzeexportlogs.sh /scripts/ | ||
COPY ./compose/openshiftjobs/scripts/backupmediapvc.sh /scripts/ | ||
COPY ./compose/openshiftjobs/scripts/ziplogs.sh /scripts/ | ||
|
||
RUN sed -i 's/\r$//g' /entrypoint.sh && chmod +x /entrypoint.sh | ||
RUN sed -i 's/\r$//g' /scripts/analyzeexportlogs.sh && chmod +x /scripts/analyzeexportlogs.sh | ||
RUN sed -i 's/\r$//g' /scripts/backupmediapvc.sh && chmod +x /scripts/backupmediapvc.sh | ||
RUN sed -i 's/\r$//g' /scripts/ziplogs.sh && chmod +x /scripts/ziplogs.sh | ||
|
||
|
||
ENTRYPOINT ["/entrypoint.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/bin/bash | ||
|
||
# Check the number of arguments | ||
if [ "$#" -lt 1 ]; then | ||
echo "Usage: $0 <script_name> [args...]" | ||
exit 1 | ||
fi | ||
|
||
# Determine which script to run based on the first argument | ||
case "$1" in | ||
backupmediapvc) | ||
# Run backupmediapvc.sh which will backup the data from the django-media pvc to s3 storage | ||
/scripts/backupmediapvc.sh | ||
;; | ||
ziplogs) | ||
# Run ziplogs.sh which will zip all files that were created in the previous hour or older in the nginx log storage pvc | ||
/scripts/ziplogs.sh | ||
;; | ||
analyzeexportlogs) | ||
# Run analyzeexportlogs with additional arguments which will send the specified days logs through goaccess and then upload to s3. | ||
shift # Remove the first argument (script number) | ||
/scripts/analyzeexportlogs.sh "$@" | ||
;; | ||
*) | ||
echo "Invalid script" | ||
exit 1 | ||
;; | ||
esac |
Oops, something went wrong.