Skip to content
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
87 commits
Select commit Hold shift + click to select a range
5f9ab9e
FAIL_URL and parametrized commad
dantebarba Apr 27, 2019
14b0cbb
removed unnecesary env var
dantebarba Apr 27, 2019
1499410
removed unnecesary env
dantebarba Apr 27, 2019
193cf8c
readme formatting
dantebarba Apr 27, 2019
2c93060
update to latest version
pfidr34 Apr 30, 2019
08f7928
Update LICENSE.md
pfidr34 Apr 30, 2019
45856a4
Update README.md
pfidr34 Apr 30, 2019
917800c
Update README.md
pfidr34 Apr 30, 2019
afdd7dc
Update Dockerfile
pfidr34 May 1, 2019
3361e6c
Merge branch 'master' of https://github.com/pfidr34/docker-rclone
pfidr34 May 1, 2019
8c3758b
Update README.md
bcardiff May 1, 2019
3e05a5a
Merge branch 'master' of https://github.com/bcardiff/docker-rclone
dantebarba May 1, 2019
a3cb72c
Merge branch 'master' of https://github.com/dantebarba/docker-rclone
dantebarba May 1, 2019
9320dc3
Added travis ci badge
dantebarba May 1, 2019
d56274e
Create FAIL_URL handling proposed by @dantebarba
pfidr34 May 1, 2019
91d6297
Add 'move' as a acceptable rclone operation.
pfidr34 May 1, 2019
dc37ad8
typo
pfidr34 May 1, 2019
25fe6e9
Add ability to roate logs after x days
pfidr34 May 1, 2019
d3fb318
Change variable name
pfidr34 May 1, 2019
4a8f9de
Autobuild for Rclone 1.48
pfidr34 Jun 23, 2019
9283a0c
Simplifies `apk add`
tlex Jul 17, 2019
1f68e69
Merge pull request #1 from tlex/simplify-apk-add
pfidr34 Jul 19, 2019
13c5663
Fix log rotation
pfidr34 Aug 19, 2019
e411ad0
Add change log to readme.md
pfidr34 Aug 20, 2019
3f9aecb
Healthchecks.io enhancements
pfidr34 Aug 20, 2019
52719b4
Update README.md
pfidr34 Aug 29, 2019
0b1738c
Update sync.sh
pfidr34 Sep 9, 2019
dc45a62
Change log directory check
pfidr34 Sep 10, 2019
2af0423
Add env variable SYNC_OPTS_EVAL.
Sep 12, 2019
43a204e
Add documentation for SYNC_OPTS_EVAL.
Sep 12, 2019
950864f
Fix typos in README.
Sep 12, 2019
afd083e
Merge pull request #5 from mistermult/eval-args
pfidr34 Sep 19, 2019
63509eb
Update SYNC_EVAL logic
pfidr34 Sep 19, 2019
c870f54
Update README.MD
pfidr34 Sep 19, 2019
2969596
Add ability to sync once then exit
pfidr34 Sep 23, 2019
e1e85ad
Update README.md
pfidr34 Sep 23, 2019
6583f02
Update README.md
pfidr34 Sep 23, 2019
af616c7
Update README.md
pfidr34 Sep 23, 2019
ef5c482
Increment version
pfidr34 Oct 1, 2019
2d144b3
Version update
pfidr34 Oct 27, 2019
d8d7a55
Update version
pfidr34 Nov 6, 2019
64e0f8e
Initial support for passing UID/GID
Nov 14, 2019
ab32406
typo
Nov 14, 2019
ad02bcf
Don't assume root, and switch to user if they arleady exist
Nov 15, 2019
b178f94
Merge pull request #10 from mikeburgh/master
pfidr34 Nov 18, 2019
19c6e1b
Update Readme
pfidr34 Nov 18, 2019
d32a6b2
Update version
pfidr34 Nov 20, 2019
a2a6d7d
Use correct user for Docker Hub image
JakeWharton Jan 28, 2020
4709799
Merge pull request #11 from JakeWharton/patch-2
pfidr34 Jan 28, 2020
262fd1a
Update rclone version
pfidr34 Feb 1, 2020
2df3451
Handle spaces in SYNC_SRC and SYNC_DEST options
pfidr34 May 17, 2020
5b4abe8
Change how sync.sh handles errors from rclone
pfidr34 May 18, 2020
0bf2c95
Remove DEBUG echo
pfidr34 May 18, 2020
5d9fbc0
Various updates, see README.md
pfidr34 May 28, 2020
7af4ba1
Updated to Rclone 1.52.0 and added build script
pfidr34 May 28, 2020
8476c6c
eval rclone command | set error handling on source dir check
pfidr34 Jun 9, 2020
e9a6f89
Fix whitespace issues in SYNC_SRC and SYNC_DEST
pfidr34 Jun 9, 2020
de665fb
Revert last change
pfidr34 Jun 9, 2020
2ee0220
remove sync warning
dantebarba Jun 10, 2020
3a214d2
Update to Rclone 1.52.1
pfidr34 Jun 11, 2020
0a66a61
Update to 1.52.2
pfidr34 Jun 25, 2020
0fd259a
Update to 1.52.3
pfidr34 Aug 21, 2020
afb75ca
Add ability to send log data to healthchecks.io
pfidr34 Aug 31, 2020
8ad2acc
Update to 1.53.0
pfidr34 Sep 5, 2020
949a7dc
Update to 1.53.1
pfidr34 Sep 13, 2020
bb1f665
Update to 1.53.2
pfidr34 Oct 28, 2020
f5ca4af
Update to 1.53.3
pfidr34 Nov 23, 2020
760b8bc
Update to 1.53.4
pfidr34 Jan 22, 2021
5d2a808
Update to 1.54.0
pfidr34 Feb 5, 2021
30d4e8b
Update to 1.54.1
pfidr34 Mar 10, 2021
e284c5b
Update to 1.55.0 & 1.55.1
pfidr34 Jun 26, 2021
531570b
Update to 1.56.0
pfidr34 Aug 25, 2021
39e4cb4
Update to 1.56.1
pfidr34 Sep 27, 2021
2c0e712
Update to 1.56.2
pfidr34 Oct 4, 2021
b322fcc
Update to 1.57.0
pfidr34 Nov 18, 2021
46c8215
Fix wrong healtcheck for DIR_CHECK, no OUTPUT_LOG.
mistermult Feb 3, 2022
492642c
Merge pull request #29 from mistermult/fix-return-code
pfidr34 Apr 25, 2022
86bfdd7
Update to 1.58.0
pfidr34 Apr 25, 2022
3d39e35
Update to 1.59.0
pfidr34 Jul 18, 2022
2fb9c19
Update to 1.61.1
pfidr34 Feb 7, 2023
c59baf3
Update to version 1.63.0
pfidr34 Jul 6, 2023
831432b
Merge remote-tracking branch 'fork/master' into pfidr34/docker-rclone
dantebarba Jul 14, 2023
ba0367a
Merge pull request #3 from dantebarba/pfidr34/docker-rclone
dantebarba Jul 14, 2023
6067516
Added new SUCCESS_CODES configuration
dantebarba Jul 14, 2023
d1033ef
Changed the incompatible bash operator with a compatible sh solution
dantebarba Jul 14, 2023
cdb0ff0
Solve unexpected "then"
dantebarba Jul 18, 2023
a4c33f2
Merge pull request #4 from dantebarba/feat/add-success-codes
dantebarba Jul 20, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ ENV CRON=
ENV CRON_ABORT=
ENV FORCE_SYNC=
ENV CHECK_URL=
ENV FAIL_URL=
ENV TZ=
ENV COMMAND=sync

RUN apk -U add ca-certificates fuse wget dcron tzdata \
&& rm -rf /var/cache/apk/* \
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,15 @@ $ docker run --rm -it -v $(pwd)/config:/config bcardiff/rclone

A few environment variables allow you to customize the behavior of the sync:

* `COMMAND` `rclone` command, e.g `sync`, `copy`, `move`.
Defaults to `sync`
* `SYNC_SRC` source location for `rclone sync` command
* `SYNC_DEST` destination location for `rclone sync` command
* `CRON` crontab schedule `0 0 * * *` to perform sync every midnight
* `CRON_ABORT` crontab schedule `0 6 * * *` to abort sync at 6am
* `FORCE_SYNC` set variable to perform a sync upon boot
* `CHECK_URL` [healthchecks.io](https://healthchecks.io) url or similar cron monitoring to perform a `GET` after a successful sync
* `FAIL_URL` Fail URL to perform a `GET` after unsuccesful execution. Default: `CHECK_URL` with appended "/fail" at the end
Comment thread
dantebarba marked this conversation as resolved.
Outdated
* `SYNC_OPTS` additional options for `rclone sync` command. Defaults to `-v`
* `TZ` set the [timezone](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) to use for the cron and log `America/Argentina/Buenos_Aires`

Expand Down
4 changes: 4 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ then
else
# SYNC_SRC and SYNC_DEST setup
# run sync either once or in cron depending on CRON
if [ -z "$FAIL_URL" ]
then
FAIL_URL="${CHECK_URL}/fail"
fi
if [ -z "$CRON" ]
then
echo "INFO: No CRON setting found. Running sync once."
Expand Down
15 changes: 9 additions & 6 deletions sync.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#!/bin/sh

set -e

echo "INFO: Starting sync.sh pid $$ $(date)"

if [ `lsof | grep $0 | wc -l | tr -d ' '` -gt 1 ]
Expand All @@ -14,14 +12,19 @@ echo $$ > /tmp/sync.pid
if test "$(rclone ls $SYNC_SRC $RCLONE_OPTS)"; then
# the source directory is not empty
# it can be synced without clear data loss
echo "INFO: Starting rclone sync $SYNC_SRC $SYNC_DEST $RCLONE_OPTS $SYNC_OPTS"
rclone sync $SYNC_SRC $SYNC_DEST $RCLONE_OPTS $SYNC_OPTS

echo "INFO: Starting rclone $COMMAND $SYNC_SRC $SYNC_DEST $RCLONE_OPTS $SYNC_OPTS"
rclone $COMMAND $SYNC_SRC $SYNC_DEST $RCLONE_OPTS $SYNC_OPTS
export RETURN_CODE=$?
if [ -z "$CHECK_URL" ]
then
echo "INFO: Define CHECK_URL with https://healthchecks.io to monitor sync job"
else
wget $CHECK_URL -O /dev/null
if [ "$RETURN_CODE" == 0 ]
then
wget $CHECK_URL -O /dev/null
else
wget $FAIL_URL -O /dev/null
fi
fi
else
echo "WARNING: Source directory is empty. Skipping sync command."
Expand Down