https://hub.docker.com/r/johanmarx/table-archiver
An image used to archive data from a working source table to an archive destination table
Alternate name?
Bash script located at:
/scripts/archive.sh
Run it manually or with Kubernetes CronJob
Passed to the script for configuration.
| VAR | DESCRIPTION |
|---|---|
| Source Setup | |
SRC_HOST | Host for source |
SRC_DB | Database for source |
SRC_USER | User for source |
SRC_PASSWORD | Password for source |
SRC_SSL | <Default: "FALSE"> To use Azure CA certificate and SSL for source connection, set to string "TRUE" |
SRC_TABLE | Table for source, must exist |
SRC_WHERE | <Default: 1=1> Where clause for source table, defaults to all rows. Eg. Id < 420 |
| Destination Setup | |
DEST_HOST | Host for destination |
DEST_DB | Database for destination |
DEST_USER | User for destination |
DEST_PASSWORD | Password for destination |
DEST_SSL | <Default: "FALSE"> To use Azure CA certificate and SSL for destination connection, set to string "TRUE" |
| Date Setup | |
DATE_FORMAT | <Default: %Y_%m> Used to create the destination table from the source table. Eg. a value of %Y_%m will prefix the current year and month. auditlog will become 2024_07_auditlog date formats |
DATE_MODIFIER | <Default: unset> Optional argument passed to date -d when creating the destination table name. Example: 7 days ago will produce a table name based on the date from one week ago. If unset, the current date is used. |
| Other | |
BATCH_SIZE | <Default: 1000> Used to limit the number of rows archived from a table in a single batch |
apiVersion: batch/v1
kind: CronJob
metadata:
name: cronjob-archiver-database-table
spec:
schedule: "0 * * * *" # Run every hour
suspend: false
jobTemplate:
spec:
suspend: false
activeDeadlineSeconds: 3300 # Limit run to 55 minutes
template:
spec:
containers:
- name: archiver-database-table-container
image: archiver
imagePullPolicy: IfNotPresent
command:
- bash
- /scripts/archive.sh
envFrom:
- configMapRef:
name: archiver-database-table-configmap
restartPolicy: Never
Content type
Image
Digest
sha256:f37e85a7f…
Size
129.7 MB
Last updated
almost 2 years ago
docker pull johanmarx/table-archiver