Skip to content
This repository was archived by the owner on Jan 23, 2024. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ See my [repository of addons][hassio-addons] for more information.
|`remote_directory`|Yes|The directory to put the backups on the remote server.|
|`zip_password`|No|If set then the backup will be contained in a password protected zip|
|`keep_local_backup`|No|Control how many local backups you want to preserve. Default (`""`) is to keep no local backups created from this addon. If `all` then all loocal backups will be preserved. A positive integer will determine how many of the latest backups will be preserved. Note this will delete other local backups created outside this addon.
|`ssh_ciphers`|No|Optional ciphers to use for `SCP`. e.g. `aes128-cbc,3des-cbc` This is useful if you need to connect to a machine running an old version of ssh server.|

## <a name='example'></a>Example: daily backups at 4 AM

Expand Down
2 changes: 2 additions & 0 deletions remote-backup/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"hassio_role": "backup",
"map": ["backup:rw"],
"options": {
"ssh_ciphers": "",
"ssh_host": "",
"ssh_port": 22,
"ssh_user": "",
Expand All @@ -19,6 +20,7 @@
"keep_local_backup": ""
},
"schema": {
"ssh_ciphers": "str",
"ssh_host": "str",
"ssh_port": "int",
"ssh_user": "str",
Expand Down
4 changes: 4 additions & 0 deletions remote-backup/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ set -e
CONFIG_PATH=/data/options.json

# parse inputs from options
SSH_CIPHERS=$(jq --raw-output ".ssh_ciphers" $CONFIG_PATH)
SSH_HOST=$(jq --raw-output ".ssh_host" $CONFIG_PATH)
SSH_PORT=$(jq --raw-output ".ssh_port" $CONFIG_PATH)
SSH_USER=$(jq --raw-output ".ssh_user" $CONFIG_PATH)
Expand All @@ -25,6 +26,9 @@ function add-ssh-key {
echo " User ${SSH_USER}"
echo " Port ${SSH_PORT}"
echo " StrictHostKeyChecking no"
if [ -n "$SSH_CIPHERS" ]; then
echo " Ciphers ${SSH_CIPHER}"
fi
) > "${HOME}/.ssh/config"

while read -r line; do
Expand Down