This is a simple docker container to start single runs of owncloud syncs.
docker run -ti --rm \
--volume ~/owncloud/data:/data \
--volume ~/owncloud/conf:/conf \
--env SERVER=https://my.owncloud.test/remote.php/webdav/Path/To/Sync \
--env HOST_UID=$(id -u) \
--env HOST_GID=$(id -g) \
citrin/owncloud-client
This syncs the data in ~/owncloud/data
with Path/To/Sync
on the server my.owncloud.test
.
The credentials are safed in the netrc file ~/owncloud/conf/.netrc
For example:
machine my.owncloud.test login myuser password mypassword
Currently only .netrc
and sync-exclude.lst
(passed as --exclude
) are supported. All other files are ignored.
The following environment variables are supported:
- HOST_UID
- The user id to write the files as (Ubuntu default: 1000)
- HOST_GID
- The group id to write the files as (Ubuntu default: 1000)
- TRUST_SELFSIGN
- If set to 1 it adds --trust to the owncloudcmd
- SYNC_HIDDEN
- If set to 1 it adds -h to the owncloudcmd
- SHOW_OUTPUT
- If set to 1 it removes --silent from the owncloudcmd
If you don't want the custom options --non-interactive -n
to be passed to owncloudcmd you can overwrite the CMD:
docker run -ti --rm \
--volume ~/owncloud/data:/data \
--volume ~/owncloud/conf:/conf \
--env HOST_UID=$(id -u) \
--env HOST_GID=$(id -g) \
citrin/owncloud-client owncloudcmd /data https://my.owncloud.test/remote.php/webdav/Path/To/Sync
There you can pass any owncloudcmd options you might need.
Build with:
docker build --tag citrin/owncloud-client .
Push with:
docker login
docker push citrin/owncloud-client