Skip to content

Commit

Permalink
one more time
Browse files Browse the repository at this point in the history
  • Loading branch information
tarkilhk committed Mar 28, 2024
1 parent ed4eae1 commit bf2de41
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,9 @@ COPY scripts/start-cron.sh /scripts/start-cron.sh
# Make the scripts executable
RUN chmod +x /scripts/rsync-script.sh /scripts/start-cron.sh

# piped logfile into PID 1 in order to see log content in docker logs
RUN touch /var/logs/cron.log
RUN ln -sf /proc/1/fd/1 /var/logs/cron.log

# Run the start-cron script when the container starts
CMD ["/scripts/start-cron.sh"]
2 changes: 1 addition & 1 deletion 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} /scripts/rsync-script.sh >> /proc/1/fd/1 2>&1" | crontab -
echo "${CRON_FREQUENCY} /scripts/rsync-script.sh >> /var/log/cron.log 2>&1" | crontab -

# Start the cron service
crond -l 2 -f

0 comments on commit bf2de41

Please sign in to comment.