Hi,
Maybe someone can help.
I want to use an automation to copy files from HA to a mounted directory (a Win PC).
To do this I try to use the integrated shell_command.
The command works without any problems in the HA terminal.
But I see an error in the automation.
Automation:
alias: Automation - Backup CSV Files auf WindowsPC
description: ""
trigger:
- platform: time
at: "02:00:00"
condition: []
action:
- service: shell_command.backup_csv_files
data: {}
response_variable: respons_shell
mode: single
configuration.yaml:
shell_command:
backup_csv_files: "cp -r /homeassistant/CSV-Files/ /share/HOMEWinPC/"
Error after execution:
context:
id: 01HMNG9SE0CNPF16HS7ZH4RTQ0
parent_id: 01HMNG9SDZJJPGHC5RX92ZN937
user_id: null
respons_shell:
stdout: ''
stderr: 'cp: can''t stat ''/homeassistant/CSV-Files'': No such file or directory'
returncode: 1
I also tried the command preceded by ‘/bin/bash cp…’ or ‘/bin cp…’ and also several other attempts. However, always the same error.
Does anyone know what I’m doing wrong here?