Skip to content

Commit

Permalink
changed structure + few fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
tarkilhk committed Mar 28, 2024
1 parent c9991fc commit 5ec5a72
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 9 deletions.
12 changes: 6 additions & 6 deletions Dockerfile
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"]
2 changes: 0 additions & 2 deletions crontab

This file was deleted.

File renamed without changes.
2 changes: 1 addition & 1 deletion start-cron.sh → scripts/start-cron.sh
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

0 comments on commit 5ec5a72

Please sign in to comment.