commit a636f1cbd1505e5b62fa08e1e0af10fdf7b9f37a Author: Leonard Excoffier Date: Wed May 1 17:43:52 2024 -0400 Initial commit diff --git a/dockerfile b/dockerfile new file mode 100644 index 0000000..f9537f2 --- /dev/null +++ b/dockerfile @@ -0,0 +1,22 @@ +FROM debian:12 + +WORKDIR /rclone + +ENV TZ=America/New_York +ENV CRON_JOB=/rclone/appdata/cron/cron.conf +ENV RCLONE_CONFIG=/rclone/appdata/rclone/rclone.conf + +RUN apt-get update && \ + apt-get install -y cron && \ + apt-get install -y rclone && \ + apt-get install -y procps && \ + rm -rf /var/lib/apt/lists/* + +RUN mkdir -p /rclone/appdata/cron && \ + mkdir -p /rclone/appdata/rclone && \ + mkdir -p /rclone/appdata/logs && \ + mkdir -p /backupsource + +COPY start.sh . + +CMD ["./start.sh"] diff --git a/start.sh b/start.sh new file mode 100644 index 0000000..e023e7d --- /dev/null +++ b/start.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +# Set the PATH for the cron jobs +echo "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" > /etc/cron.d/rclone_env + +# Write the RCLONE_CONFIG environment variable to the cron environment file +echo "RCLONE_CONFIG=$RCLONE_CONFIG" >> /etc/cron.d/rclone_env + +# Append the contents of the CRON_JOB file to the cron environment file +cat $CRON_JOB >> /etc/cron.d/rclone_env + +# Install new cron file +crontab /etc/cron.d/rclone_env + +# Start cron +cron -f