From 20b9100624e38f2e7a8ea6783d3c92d97cce57e7 Mon Sep 17 00:00:00 2001 From: Audrey Jensen Date: Thu, 3 Apr 2025 08:24:53 -0500 Subject: [PATCH] add crontab file --- dockerfile | 14 ++++++++++---- mysqlCron | 1 + 2 files changed, 11 insertions(+), 4 deletions(-) create mode 100644 mysqlCron diff --git a/dockerfile b/dockerfile index a76e154..e1a41c0 100644 --- a/dockerfile +++ b/dockerfile @@ -1,4 +1,10 @@ -FROM mysql:latest -COPY backup.sh /usr/local/bin/ -RUN chmod +x /usr/loca/bin/backup.sh -CMD ["cron","-f"] \ No newline at end of file +FROM mysql:8-debian +RUN apt-get update --allow-unauthenticated --allow-insecure-repositories +RUN apt-get -y install -qq --force-yes cron +RUN echo "Log Start" >> /var/log/cron.log +RUN mkdir /backup +ADD backup.sh /usr/local/bin/ +ADD mysqlCron /etc/cron.d/mysqlCron +RUN chmod 0644 /etc/cron.d/mysqlCron +RUN chmod 0744 /usr/local/bin/backup.sh +CMD cron && tail -f /var/log/cron.log \ No newline at end of file diff --git a/mysqlCron b/mysqlCron new file mode 100644 index 0000000..a7d03ba --- /dev/null +++ b/mysqlCron @@ -0,0 +1 @@ +50 23 * * * backup.sh >> /var/log/cron.log 2>&1