Github backup with bash script not working

Hi, I’m trying to setup a frontend script for updating my homeassistant repository on Github.
During the last hours i tried but I did not succeed (script appear in the frontend but doesn’t work, it works only via terminal CLI).
PS: I’m using HASSIO on RPI3.

First of all I used this command using SSH terminal: git config remote.origin.url https://User:[email protected]/MyNameOnGithub/Repository.git

Here my setup:


shell_command: !include shell_commands.yaml
script: !include_dir_named scripts


gitupdate: '/config/'


cd /config/
git config --global "[email protected]"
git config --global "myGithubusername"
git add .
git status
git commit -m "Auto Backup"
git push -u origin master

(into the scripts directory) gitupdate.yaml:

alias: gitupdate
  - service: shell_command.gitupdate


  view: yes
  name: Home
  icon: mdi:home
    - script.gitupdate

Can someone help me?
Thank you :slight_smile:

Can you try it with an absolute path to the script?

Hi @fabaff, the only problem is that I don’t know what is the absolute path of the script (because i’m using
Can you help me with it?

Edit: I tried editing shell_commands.yaml:

gitupdate: '/resin-data/homeassistant/'

But it didn’t work

The homeassistant container does not have git installed so you’re probably going to have to create an addon to automate your git commits.

1 Like

@Mike1 did you ever got it working?