diff --git a/Dockerfile b/Dockerfile index 6048891..478408f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,15 +1,15 @@ # Use the Alpine base image FROM alpine:latest -# Install cron -RUN apk add --no-cache dcron +# Install cron, rsync, and bash +RUN apk add --no-cache dcron rsync bash # Copy the rsync script and the start-cron script into the Docker image -COPY rsync-script.sh /path/to/rsync-script.sh -COPY start-cron.sh /start-cron.sh +COPY scripts/rsync-script.sh /scripts/rsync-script.sh +COPY scripts/start-cron.sh /scripts/start-cron.sh # Make the scripts executable -RUN chmod +x /path/to/rsync-script.sh /start-cron.sh +RUN chmod +x /scripts/rsync-script.sh /scripts/start-cron.sh # Run the start-cron script when the container starts -CMD ["/start-cron.sh"] \ No newline at end of file +CMD ["/scripts/start-cron.sh"] \ No newline at end of file diff --git a/crontab b/crontab deleted file mode 100644 index 5d0b5b1..0000000 --- a/crontab +++ /dev/null @@ -1,2 +0,0 @@ -0 2 * * * /rsync-script.sh >> /var/log/cron.log 2>&1 -# Don't remove the empty line at the end of this file. It is required to run the cron job diff --git a/rsync-script.sh b/scripts/rsync-script.sh similarity index 100% rename from rsync-script.sh rename to scripts/rsync-script.sh diff --git a/start-cron.sh b/scripts/start-cron.sh similarity index 60% rename from start-cron.sh rename to scripts/start-cron.sh index fd98059..651e123 100644 --- a/start-cron.sh +++ b/scripts/start-cron.sh @@ -1,7 +1,7 @@ #!/bin/sh # Write a new crontab file -echo "${CRON_FREQUENCY} /path/to/rsync-script.sh >> /var/log/cron.log 2>&1" > /etc/crontab +echo "${CRON_FREQUENCY} /scripts/rsync-script.sh >> /var/log/cron.log 2>&1" > /etc/crontab # Start the cron service cron -f \ No newline at end of file