Skip to content

Commit dbc9a7e

Browse files
First commit
1 parent d147565 commit dbc9a7e

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ ADD etc/lftp.conf /etc/lftp.conf
3434
ADD etc/ssh/ssh_config.d/strict.conf /etc/ssh/ssh_config.d/strict.conf
3535
COPY backup.sh backup-entrypoint.sh cron-foreground.sh /usr/local/bin/
3636

37+
# Create cronjob log file
38+
RUN touch /var/log/cron
39+
RUN ln -sf /proc/$$/fd/1 /var/log/cron
3740
RUN echo "cron.* /dev/stdout" >> /etc/rsyslog.conf && rm -fr /etc/cron.* && mkdir /etc/cron.d
3841

3942
#CMD ["/bin/bash","/conf/doBackup.sh"]

backup-entrypoint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ chown root:crontab $crontab
99

1010
if [[ "$1" =~ ^[0-9*] ]]; then
1111
while test $# -gt 0; do
12-
echo "$1 > /dev/stdout 2>&1" >> $crontab
12+
echo "$1 > /var/log/cron 2>&1" >> $crontab
1313
shift
1414
done
1515
set -- cron-foreground.sh

cron-foreground.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#!/bin/bash
22
set -e
33

4-
rsyslogd && true
4+
rsyslogd
55
cron -f -L 15
66

7-
#tail -f /var/log/cron

0 commit comments

Comments
 (0)