-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
7 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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"] | ||
CMD ["/scripts/start-cron.sh"] |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |