Skip to content

Commit 14fd6d3

Browse files
Drone CIMaxim RMaxim Romanenko
committed
Added NO_COMPRESS key (#22)
fix(backup.sh.j2): no_compress to lower feat: added NO_COMPRESS key refs. #138787 Co-authored-by: Maxim R <[email protected]> Reviewed-on: https://gitea.osshelp.io/docker/backup/pulls/22 Co-Authored-By: Maxim Romanenko <[email protected]> Co-Committed-By: Maxim Romanenko <[email protected]>
1 parent e349d5e commit 14fd6d3

File tree

3 files changed

+63
-60
lines changed

3 files changed

+63
-60
lines changed

Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ ENV TIMEZONE="Europe/Moscow" \
4141
MONGO_IGNORE_DBS="[]" \
4242
NO_PUSHGATEWAY="0" \
4343
STORAGE_UPLOAD_DIR='""' \
44-
ALT_STORAGE_UPLOAD_DIR='""'
44+
ALT_STORAGE_UPLOAD_DIR='""' \
45+
NO_COMPRESS="0"
4546

4647
ENTRYPOINT ["entrypoint.sh"]

README.md

Lines changed: 60 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -57,63 +57,64 @@ Internal vars in CUSTOM_BACKUP_COMMANDS must be escaped like `$$`.
5757

5858
## Parameters
5959

60-
Setting|Default|Description
61-
---|---|---
62-
`ARCHIVER_OPTS`|`-`|Additional optioins for archiver
63-
`COMPRES_DIRS`|`[]`|List of directories for backup
64-
`COMPRES_DIRS_EXCLUDE`|`[]`|List of direcotries for exlude
65-
`CRON_TIME`|`{min: 15, hour: 3}`|Backup task cron time
66-
`CRON_LOGLEVEL`|`8`|Cron Log Level. Most verbose 0
67-
`CUSTOM_BACKUP_COMMANDS`|-|Custom command(s) for backup function
68-
`FILES_FOR_COUNT`|`[]`|List of files for manual counting
69-
`GITLAB_DIR`|-| Path for Gitlab backup dir (mounted from gitlab container)
70-
`LOCAL_DAYS`|`0`|Number of local copies +1
71-
`MONGO_HOST`|-|MongoDB host
72-
`MONGO_AUTH_DB`|`admin`|MongoDB authentication database
73-
`MONGO_USER`|`admin`|MongoDB user
74-
`MONGO_PASSWORD`|-|MongoDB password
75-
`MONGO_IGNORE_DBS`|`[]`|List of ignored databases
76-
`MAILTO`|-|Notify email address
77-
`MYSQL_HOST`|-|MySQL host
78-
`MYSQL_PORT`|`3306`|MySQL port
79-
`MYSQL_USER`|`root`|MySQL user
80-
`MYSQL_PASSWORD`|-|MySQL password (not added to my.cnf if it's not defineded)
81-
`MYSQL_OPTS`|-|Additional optioins for mysqldump
82-
`MYSQL_IGNORE_DBS`|`[information_schema, performance_schema, pinba, phpmyadmin, sys]`|List of ignored databases
83-
`NO_PUSHGATEWAY` |`0`|Disable send metrics to Pushgateway if `1`
84-
`POSTGRES_HOST`|`postgres`|PostgreSQL host
85-
`POSTGRES_PORT`|`5432`|PostgreSQL port
86-
`POSTGRES_CONNECTION_DB`|`postgres`|PostgreSQL connection db
87-
`POSTGRES_USER`|`postgres`|PostgreSQL user
88-
`POSTGRES_PASSWORD`|-|PostgreSQL password
89-
`POSTGRES_IGNORE_DBS`|`[template]`|List of ignored databases
90-
`POSTGRES_SKIP_GLOBALS`|-|Skip dump globals objects if `1`. Useful for managed PostgreSQL servers
91-
`PUSHGATEWAY_URL`|`http://pushgateway:9091`|Pushgateway URL
92-
`PUSHGATEWAY_OPTS`|`-`|Additional curl parameters, which is used by functions to transfer data to Pushgateway
93-
`RCLONE_STORAGE`|-|Rclone remote storage
94-
`RCLONE_ALT_STORAGE`|-|Rclone alternative remote storage (additional)
95-
`REMOTE_SCHEME`|`{daily: 7, weekly: 4, monthly: 3}`|Number of remote copies by type
96-
`REDIS_HOST`|-|Redis host
97-
`REDIS_PASSWORD`|-|Redis password
98-
`SSMTP_MAILHUB`|container default gateway|Mail relay host
99-
`SSMTP_HOSTNAME`|`hostname -f`|SSMTP hostname
100-
`SSMTP_REWRITE_DOMAIN`|-|SSMTP rewrite domain
101-
`SSMTP_FROM_LINE_OVERRIDE`|-|SSMTP From line override
102-
`STORAGE_UPLOAD_DIR/ALT_STORAGE_UPLOAD_DIR`|-|Target directory to upload to the storage/alternative storage
103-
`STORAGE_SYNC_MODE`|`default`|Rclone sync function mode, set no_check if you need disable checking files in storage
104-
`SYNC_DIRS`|`[]`|List of directories for sync
105-
`SERVER_NAME`|-|Server for notifies
106-
`TIMEZONE`|`Europe/Moscow`|Timezone
60+
Setting | Default | Description
61+
--------------------------------------------|--------------------------------------------------------------------|---------------------------------------------------------------------------------------
62+
`ARCHIVER_OPTS` | `-` | Additional optioins for archiver
63+
`COMPRES_DIRS` | `[]` | List of directories for backup
64+
`COMPRES_DIRS_EXCLUDE` | `[]` | List of direcotries for exlude
65+
`CRON_TIME` | `{min: 15, hour: 3}` | Backup task cron time
66+
`CRON_LOGLEVEL` | `8` | Cron Log Level. Most verbose 0
67+
`CUSTOM_BACKUP_COMMANDS` | - | Custom command(s) for backup function
68+
`FILES_FOR_COUNT` | `[]` | List of files for manual counting
69+
`GITLAB_DIR` | - | Path for Gitlab backup dir (mounted from gitlab container)
70+
`LOCAL_DAYS` | `0` | Number of local copies +1
71+
`MONGO_HOST` | - | MongoDB host
72+
`MONGO_AUTH_DB` | `admin` | MongoDB authentication database
73+
`MONGO_USER` | `admin` | MongoDB user
74+
`MONGO_PASSWORD` | - | MongoDB password
75+
`MONGO_IGNORE_DBS` | `[]` | List of ignored databases
76+
`MAILTO` | - | Notify email address
77+
`MYSQL_HOST` | - | MySQL host
78+
`MYSQL_PORT` | `3306` | MySQL port
79+
`MYSQL_USER` | `root` | MySQL user
80+
`MYSQL_PASSWORD` | - | MySQL password (not added to my.cnf if it's not defineded)
81+
`MYSQL_OPTS` | - | Additional optioins for mysqldump
82+
`MYSQL_IGNORE_DBS` | `[information_schema, performance_schema, pinba, phpmyadmin, sys]` | List of ignored databases
83+
`NO_PUSHGATEWAY` | `0` | Disable send metrics to Pushgateway if `1`
84+
`POSTGRES_HOST` | `postgres` | PostgreSQL host
85+
`POSTGRES_PORT` | `5432` | PostgreSQL port
86+
`POSTGRES_CONNECTION_DB` | `postgres` | PostgreSQL connection db
87+
`POSTGRES_USER` | `postgres` | PostgreSQL user
88+
`POSTGRES_PASSWORD` | - | PostgreSQL password
89+
`POSTGRES_IGNORE_DBS` | `[template]` | List of ignored databases
90+
`POSTGRES_SKIP_GLOBALS` | - | Skip dump globals objects if `1`. Useful for managed PostgreSQL servers
91+
`PUSHGATEWAY_URL` | `http://pushgateway:9091` | Pushgateway URL
92+
`PUSHGATEWAY_OPTS` | `-` | Additional curl parameters, which is used by functions to transfer data to Pushgateway
93+
`RCLONE_STORAGE` | - | Rclone remote storage
94+
`RCLONE_ALT_STORAGE` | - | Rclone alternative remote storage (additional)
95+
`REMOTE_SCHEME` | `{daily: 7, weekly: 4, monthly: 3}` | Number of remote copies by type
96+
`REDIS_HOST` | - | Redis host
97+
`REDIS_PASSWORD` | - | Redis password
98+
`SSMTP_MAILHUB` | container default gateway | Mail relay host
99+
`SSMTP_HOSTNAME` | `hostname -f` | SSMTP hostname
100+
`SSMTP_REWRITE_DOMAIN` | - | SSMTP rewrite domain
101+
`SSMTP_FROM_LINE_OVERRIDE` | - | SSMTP From line override
102+
`STORAGE_UPLOAD_DIR/ALT_STORAGE_UPLOAD_DIR` | - | Target directory to upload to the storage/alternative storage
103+
`STORAGE_SYNC_MODE` | `default` | Rclone sync function mode, set no_check if you need disable checking files in storage
104+
`SYNC_DIRS` | `[]` | List of directories for sync
105+
`SERVER_NAME` | - | Server for notifies
106+
`TIMEZONE` | `Europe/Moscow` | Timezone
107+
`NO_COMPRESS` | `0` | Enable compressing in DB dump functions
107108

108109
### Cron time format
109110

110-
Setting|Default|Description
111-
---|---|---
112-
`min`|`15`|Minute
113-
`hour`|`3`|Hour
114-
`day`|`*`|Day of mounth
115-
`mounth`|`*`|Mounth
116-
`day_of_week`|`*`|Day of week
111+
Setting | Default | Description
112+
--------------|---------|--------------
113+
`min` | `15` | Minute
114+
`hour` | `3` | Hour
115+
`day` | `*` | Day of mounth
116+
`mounth` | `*` | Mounth
117+
`day_of_week` | `*` | Day of week
117118

118119
Example:
119120

@@ -126,11 +127,11 @@ Example:
126127

127128
The format is the same as in [the Ansible role](https://gitea.osshelp.ru/ansible/rclone):
128129

129-
Setting|Default|Description
130-
---|---|---
131-
`name`|-|Storage name
132-
`bucket`|-|Storage bucket name, if not set then equals name
133-
`key`|-|Key:value for rclone storage
130+
Setting | Default | Description
131+
---------|---------|-------------------------------------------------
132+
`name` | - | Storage name
133+
`bucket` | - | Storage bucket name, if not set then equals name
134+
`key` | - | Key:value for rclone storage
134135

135136
Example:
136137

templates/backup.sh.j2

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ local_days={{ LOCAL_DAYS }}
77
remote_backups_weekly={{ REMOTE_SCHEME.weekly }}
88
remote_backups_monthly={{ REMOTE_SCHEME.monthly }}
99
{% endif %}
10+
no_compress={{ NO_COMPRESS }}
1011
tar_exclude=({%for dir in COMPRES_DIRS_EXCLUDE %}--exclude={{ dir }} {% endfor %})
1112
archiver_opts=({{ ARCHIVER_OPTS | default('')}})
1213
mysql_opts=({{ MYSQL_OPTS | default('')}})

0 commit comments

Comments
 (0)