Skip to content
This repository has been archived by the owner on Oct 30, 2024. It is now read-only.

Commit

Permalink
Merge pull request #441 from Poeschl/dev
Browse files Browse the repository at this point in the history
Rsync-local updates
  • Loading branch information
Poeschl authored Oct 13, 2023
2 parents 080d8e2 + e8cb9af commit 9bc93f7
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 14 deletions.
3 changes: 3 additions & 0 deletions .github/labels.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
- color: '072540'
name: hacktoberfest
description: Not too heavy to lift. A nice thing for newcommers.
- color: '072540'
name: hacktoberfest-accepted
description: This PR will count towards your hacktoberfest score, even if not merged.
- color: ffffff
name: stale
description: No interactions for quite some time
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## How to contribute

1. Fork this repository and make your changes on your fork an a branch you like (I recommend to create a branch per feature).
2. Create a PR which targets the dev branch.
2. Create a PR which targets the `dev` branch.
3. After reviewed it your changes will live in the dev branch until all changes are pushed to the main branch. (Usually this is not long)

## Requirements to get Pull Requests accepted
Expand Down
8 changes: 8 additions & 0 deletions rsync-local/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
## 1.7.0 - 2023-10-13

* 🔨 Correct --archive argument (thanks @reedy | #418)
* 🔼 Updated to alpine `3.18`
* 🔼 Updated rsync to `3.2.7-r4`
* 🔼 Update coreutils to `9.3-r1`
* ✨ Add more device mappings (`/dev/sd[a-e][1-5]`)

## 1.6.0 - 2023-01-08

* 🔼 Updated rsync to `3.2.7-r0`
Expand Down
6 changes: 3 additions & 3 deletions rsync-local/DOCS.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Example config:
folders:
- source: /config
- source: /media/playlists
options: '-archive --recursive --compress'
options: '--archive --recursive --compress'
external_folder: backup
external_device: ''
```
Expand All @@ -26,7 +26,7 @@ The source folder for rsync.

### `folders` - `options` (optional)

Use your own options for rsync. This string is replacing the default one and get directly to rsync. The default is `-archive --recursive --compress --delete --prune-empty-dirs`.
Use your own options for rsync. This string is replacing the default one and get directly to rsync. The default is `--archive --recursive --compress --delete --prune-empty-dirs`.

### `external_folder`

Expand All @@ -40,4 +40,4 @@ Make sure to adjust it when for example running Home Assistant from a external d

If no device is specified all available devices will be displayed in the log. No sync takes place without device.

Available options: `/dev/sda1`, `/dev/sda2`, `/dev/sdb1`, `/dev/sdb2`
Available options: `/dev/sd[a-e][1-5]`
4 changes: 2 additions & 2 deletions rsync-local/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ FROM $BUILD_FROM AS RUNNING

RUN apk update && \
apk add --no-cache \
'rsync=3.2.7-r0' \
'coreutils=9.1-r0'
'rsync=3.2.7-r4' \
'coreutils=9.3-r1'

COPY root /
RUN chmod a+x /run.sh
Expand Down
10 changes: 5 additions & 5 deletions rsync-local/build.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
build_from:
armhf: ghcr.io/home-assistant/armhf-base:3.16
armv7: ghcr.io/home-assistant/armv7-base:3.16
aarch64: ghcr.io/home-assistant/aarch64-base:3.16
amd64: ghcr.io/home-assistant/amd64-base:3.16
i386: ghcr.io/home-assistant/i386-base:3.16
armhf: ghcr.io/home-assistant/armhf-base:3.18
armv7: ghcr.io/home-assistant/armv7-base:3.18
aarch64: ghcr.io/home-assistant/aarch64-base:3.18
amd64: ghcr.io/home-assistant/amd64-base:3.18
i386: ghcr.io/home-assistant/i386-base:3.18
25 changes: 23 additions & 2 deletions rsync-local/config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: rsync local
version: 1.6.0
version: 1.7.0
slug: rsync-local
description: Sync folders to a external usb drive with rsync.
url: https://github.com/Poeschl/Hassio-Addons/tree/main/rsync-local
Expand All @@ -25,8 +25,29 @@ map:
devices:
- /dev/sda1
- /dev/sda2
- /dev/sda3
- /dev/sda4
- /dev/sda5
- /dev/sdb1
- /dev/sdb2
- /dev/sdb3
- /dev/sdb4
- /dev/sdb5
- /dev/sdc1
- /dev/sdc2
- /dev/sdc3
- /dev/sdc4
- /dev/sdc5
- /dev/sdd1
- /dev/sdd2
- /dev/sdd3
- /dev/sdd4
- /dev/sdd5
- /dev/sde1
- /dev/sde2
- /dev/sde3
- /dev/sde4
- /dev/sde5
privileged:
- SYS_ADMIN
apparmor: false
Expand All @@ -35,7 +56,7 @@ schema:
- source: str
options: str?
external_folder: match(^[^/].+)
external_device: match(^(/dev/sd[a|b][1|2])?)
external_device: match(^(/dev/sd[a|b|c|d|e][1|2|3|4|5])?)
options:
folders:
- source: /config
Expand Down
2 changes: 1 addition & 1 deletion rsync-local/root/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ else
for (( i=0; i<folder_count; i=i+1 )); do

local=$(echo "$FOLDERS" | jq -r ".[$i].source")
options=$(echo "$FOLDERS" | jq -r ".[$i].options // \"-archive --recursive --compress --delete --prune-empty-dirs\"")
options=$(echo "$FOLDERS" | jq -r ".[$i].options // \"--archive --recursive --compress --delete --prune-empty-dirs\"")
bashio::log.info "Sync ${local} -> ${EXTERNAL_DEVICE}/${EXTERNAL_FOLDER} with options \"${options}\""
set -x
# shellcheck disable=SC2086
Expand Down

0 comments on commit 9bc93f7

Please sign in to comment.