Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backup to Github? #6

Open
arsaboo opened this issue Mar 26, 2017 · 2 comments
Open

Backup to Github? #6

arsaboo opened this issue Mar 26, 2017 · 2 comments

Comments

@arsaboo
Copy link

arsaboo commented Mar 26, 2017

Dale, wondering if it is possible to add another feature to hassctl that allows users to backup their configurations to Github. Sounds like it should be possible. I have to run the following commands to update my repo:

cd /home/hass/.homeassistant
sudo su -s /bin/bash hass
git add .
git commit -m 'your commit message'
git push origin master

The script (borrowed from @CCOSTAN) works partly, but I can run it only run it as hass user (i.e., I have to run sudo su -s /bin/bash hass before I can run ./gitupdate.sh).

#!/bin/bash
cd /home/hass/.homeassistant
git add .
git status
echo -n "Enter the Description for the Change: " [Minor Update]
read CHANGE_MSG
git commit -m "${CHANGE_MSG}"
git push origin master
exit
@bieniu
Copy link

bieniu commented Feb 16, 2018

@arsaboo I use for backup config to GitHub this script:

#!/bin/bash

sudo su -s /bin/bash homeassistant <<EOF
cd /home/homeassistant/.homeassistant
/srv/homeassistant/bin/hass --script check_config
git add .
git status
echo -n "Enter the Description for the Change: " [Minor Update]
exit
EOF
read CHANGE_MSG
sudo su -s /bin/bash homeassistant <<EOF
cd /home/homeassistant/.homeassistant
git commit -m "${CHANGE_MSG}"
git push origin master
exit
EOF

But I think that would be ideal feature for hassctl.

@bosbefok
Copy link

bosbefok commented Aug 6, 2018

Any updates on this request?
Still getting this message when running backup:

pi@Hassbian:/home/homeassistant/.homeassistant/www $ hassctl backup hassctl: command not yet implemented: backup

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants