Skip to content
This repository was archived by the owner on Jun 24, 2020. It is now read-only.

Commit b893133

Browse files
committed
fixed copying missing config file script. cron is now configurable.
1 parent 1c586b6 commit b893133

6 files changed

Lines changed: 40 additions & 7 deletions

File tree

Dockerfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ ENV BURP_VERSION="1.4.40"
1212

1313
ADD init/ /etc/my_init.d/
1414
ADD service/ /etc/service/
15+
ADD cron.d/ /etc/cron.d/
1516
RUN chmod -v +x /etc/service/*/run /etc/my_init.d/*.sh
1617

1718
RUN useradd -u 911 -U -d /config -s /bin/false abc && \
@@ -37,9 +38,9 @@ ENV PATH=$PATH:/app/usr/sbin
3738

3839
RUN sed -i 's/^directory =.*/directory = \/data/g' /defaults/burp-server.conf && \
3940
sed -i 's/\/etc\/burp/\/config/g' /defaults/burp-server.conf && \
40-
sed -i 's/^stdout =.*/stdout = 1/g' /defaults/burp-server.conf && \
4141
sed -i 's/\/usr\/sbin/\/app\/usr\/sbin/g' /defaults/burp-server.conf && \
42-
sed -i 's/\/etc\/burp/\/config/g' /defaults/CA.cnf
42+
sed -i 's/\/etc\/burp/\/config/g' /defaults/CA.cnf && \
43+
sed -i 's/^pidfile =.*/pidfile = \/app\/burp.server.pid/g' /defaults/burp-server.conf
4344

4445
RUN sed -i 's/^directory =.*/directory = \/data/g' /defaults/burp.conf && \
4546
sed -i 's/\/etc\/burp/\/config/g' /defaults/burp.conf && \

README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# computerfr33k/docker-burp-backup-server
22

3-
(description)
3+
[Burp](http://burp.grke.org/) is a network backup and restore program. It attempts to reduce network traffic and the amount of space that is used by each backup.
44

55
## Usage
66

@@ -20,8 +20,11 @@ docker create \
2020
* `-v /etc/localtime` for timesync - *optional*
2121
* `-v /config` - Configuration file location
2222
* `-v /data` - Location for backups
23-
* `-e PGID` for for GroupID - see below for explanation - *optional*
24-
* `-e PUID` for for UserID - see below for explanation - *optional*
23+
* `-e PGID` for GroupID - see below for explanation - *optional*
24+
* `-e PUID` for UserID - see below for explanation - *optional*
25+
* `-e ENABLE_CRON_SUMMARY` - Enables emailing a daily summary *optional*
26+
* `-e BURP_EMAIL` - Sets the email address to send the daily summary to. *only required if cron summary is enabled*
27+
* `-e DISABLE_CRON_DEDUP` - Disable running dedup once a week over client storage *optional*
2528

2629
It is based on phusion-baseimage with ssh removed, for shell access whilst the container is running do `docker exec -it burp-server /bin/bash`.
2730

cron.d/bedup

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
MAILTO="$BURP_EMAIL"
2+
# Put this file in /etc/cron.d and uncomment the following line to send a
3+
# summary at 6 every morning.
4+
# If your server is using a different config file to /etc/burp/burp-server.conf,
5+
# change the first argument to its path.
6+
#0 6 * * * abc /config/send_summary /config/burp-server.conf $BURP_EMAIL "Daily backup summary"
7+
8+
# The following will run file deduplication over all client storages every
9+
# Saturday at 8 in the morning. Again, if your server is using a different
10+
# config file to /etc/burp/burp-server.conf, change that argument.
11+
0 8 * * 6 abc /app/usr/sbin/bedup -l -c /config/burp-server.conf >> /app/burp-bedup 2>&1

init/30_check_config.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ function isDirEmpty {
1010
}
1111

1212
function createIfMissing {
13-
if [ -f "/config/$1" ]
13+
if [ ! -f "/config/$1" ]
1414
then
1515
cp /defaults/$1 /config/$1
1616
chown -R abc:abc /config/$1

init/90_cron.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/bash
2+
3+
if [ -n "$ENABLE_CRON_SUMMARY" ]
4+
then
5+
if [ $ENABLE_CRON_SUMMARY == 1 ]
6+
then
7+
sed -i '6s/^#//' /etc/cron.d/bedup
8+
fi
9+
else
10+
sed -i '6s/\([^#]\)/#\1/' /etc/cron.d/bedup
11+
fi
12+
13+
if [ "$DISABLE_CRON_DEDUP" ]
14+
then
15+
sed -i '11s/\([^#]\)/#\1/' /etc/cron.d/bedup
16+
else
17+
sed -i '11s/^#//' /etc/cron.d/bedup
18+
fi

service/burp-server/run

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
#!/bin/bash
2-
exec /sbin/setuser abc /usr/sbin/burp -c /config/burp-server.conf -F
2+
exec /sbin/setuser abc /app/usr/sbin/burp -c /config/burp-server.conf -F

0 commit comments

Comments
 (0)