Not really, I just like something in life to look forward toYou're a man of suspense Roy
I’ve edited the cron to run an 1425, it did, and the file was saved on the Pi and Google drive. Now re-edited to run daily at 0200.
Fingers crossed...
You can install our site as a web app on your iOS device by utilizing the Add to Home Screen feature in Safari. Please see this thread for more details on this.
Note: This feature may not be available in some browsers.
Not really, I just like something in life to look forward toYou're a man of suspense Roy
I’ve deleted the old cron job and recreated the it under sudo -i as @DaveW suggested.If it works when running the script manually but not when the cron job runs it, it could be a permissions issue. There's a good chance that the cron job is running as a user that doesn't have permission to access the folder where are trying to copy the backup file.
Not really, I just like something in life to look forward to
I’ve edited the cron to run an 1425, it did, and the file was saved on the Pi and Google drive. Now re-edited to run daily at 0200.
Fingers crossed...
Suspect the error you are getting is because the docker container is already running. Instead, try:
Code:docker-compose down docker-compose pull docker-compose up -d
This should update both TeslaMate and Grafana to the latest versions. Suggest doing a backup first before upgrading.
Linux raspberrypi 4.19.75-v7+ #1270 SMP Tue Sep 24 18:45:11 BST 2019 armv7l
The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Mon Oct 19 03:15:40 2020 from 192.168.1.13
pi@raspberrypi:~ $ docker-compose exec -T database pg_dump -U teslamate teslamate > /backuplocation/teslamate.bck
-bash: /backuplocation/teslamate.bck: No such file or directory
pi@raspberrypi:~ $ docker-compose down
ERROR: Couldn't connect to Docker daemon at http+docker://localhost - is it running?
If it's at a non-standard location, specify the URL with the DOCKER_HOST environment variable.
pi@raspberrypi:~ $ dir
docker-compose.yml -v
pi@raspberrypi:~ $ docker-compose exec -T database pg_dump -U teslamate teslamate
ERROR: No such service: database
pi@raspberrypi:~ $ docker-compose pull
Pulling teslamate ...
Pulling db ...
Pulling grafana ...
Pulling mosquitto ...
ERROR: for teslamate ('Connection aborted.', PermissionError(13, 'Permission denied'))
ERROR: for mosquitto ('Connection aborted.', PermissionError(13, 'Permission denied'))
ERROR: for grafana ('Connection aborted.', PermissionError(13, 'Permission denied'))
ERROR: for db ('Connection aborted.', PermissionError(13, 'Permission denied'))
ERROR: Couldn't connect to Docker daemon at http+docker://localhost - is it running?
If it's at a non-standard location, specify the URL with the DOCKER_HOST environment variable.
pi@raspberrypi:~ $ docker-compose down
ERROR: Couldn't connect to Docker daemon at http+docker://localhost - is it running?
If it's at a non-standard location, specify the URL with the DOCKER_HOST environment variable.
pi@raspberrypi:~ $ cd..
-bash: cd..: command not found
pi@raspberrypi:~ $ dir
docker-compose.yml -v
pi@raspberrypi:~ $ list
-bash: list: command not found
pi@raspberrypi:~ $ docker-compose -h
Define and run multi-container applications with Docker.
Usage:
docker-compose [-f <arg>...] [options] [COMMAND] [ARGS...]
docker-compose -h|--help
Options:
-f, --file FILE Specify an alternate compose file
(default: docker-compose.yml)
-p, --project-name NAME Specify an alternate project name
(default: directory name)
--verbose Show more output
--log-level LEVEL Set log level (DEBUG, INFO, WARNING, ERROR, CRITICAL)
--no-ansi Do not print ANSI control characters
-v, --version Print version and exit
-H, --host HOST Daemon socket to connect to
--tls Use TLS; implied by --tlsverify
--tlscacert CA_PATH Trust certs signed only by this CA
--tlscert CLIENT_CERT_PATH Path to TLS certificate file
--tlskey TLS_KEY_PATH Path to TLS key file
--tlsverify Use TLS and verify the remote
--skip-hostname-check Don't check the daemon's hostname against the
name specified in the client certificate
--project-directory PATH Specify an alternate working directory
(default: the path of the Compose file)
--compatibility If set, Compose will attempt to convert deploy
keys in v3 files to their non-Swarm equivalent
Commands:
build Build or rebuild services
bundle Generate a Docker bundle from the Compose file
config Validate and view the Compose file
create Create services
down Stop and remove containers, networks, images, and volumes
events Receive real time events from containers
exec Execute a command in a running container
help Get help on a command
images List images
kill Kill containers
logs View output from containers
pause Pause services
port Print the public port for a port binding
ps List containers
pull Pull service images
push Push service images
restart Restart services
rm Remove stopped containers
run Run a one-off command
scale Set number of containers for a service
start Start services
stop Stop services
top Display the running processes
unpause Unpause services
up Create and start containers
version Show the Docker-Compose version information
pi@raspberrypi:~ $ docker-compose down
ERROR: Couldn't connect to Docker daemon at http+docker://localhost - is it running?
If it's at a non-standard location, specify the URL with the DOCKER_HOST environment variable.
pi@raspberrypi:~ $ docker-compose pull
Pulling teslamate ...
Pulling db ...
Pulling grafana ...
Pulling mosquitto ...
ERROR: for teslamate ('Connection aborted.', PermissionError(13, 'Permission denied'))
ERROR: for grafana ('Connection aborted.', PermissionError(13, 'Permission denied'))
ERROR: for db ('Connection aborted.', PermissionError(13, 'Permission denied'))
ERROR: for mosquitto ('Connection aborted.', PermissionError(13, 'Permission denied'))
ERROR: Couldn't connect to Docker daemon at http+docker://localhost - is it running?
If it's at a non-standard location, specify the URL with the DOCKER_HOST environment variable.
pi@raspberrypi:~ $ docker-compose up -d
ERROR: Couldn't connect to Docker daemon at http+docker://localhost - is it running?
If it's at a non-standard location, specify the URL with the DOCKER_HOST environment variable.
pi@raspberrypi:~ $
Thanks @Melved, I appreciate the input. Unfortunately it didn't work for me & I need more help...Please? I can really only confirm that Teslamate is continuing to run fine on my pi. The following is my session and what I am getting when I SS into my pi with Putty. I started off trying to run the backup, that didn't work, then I tried to run the update, that didn't work. Then I tried to see the help file, at least that seemed to have worked, but is useless for me. (And yes I did actually use some DOS commands in there as it is all that is left that I know how to do).:
Code:Linux raspberrypi 4.19.75-v7+ #1270 SMP Tue Sep 24 18:45:11 BST 2019 armv7l The programs included with the Debian GNU/Linux system are free software; the exact distribution terms for each program are described in the individual files in /usr/share/doc/*/copyright. Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent permitted by applicable law. Last login: Mon Oct 19 03:15:40 2020 from 192.168.1.13 pi@raspberrypi:~ $ docker-compose exec -T database pg_dump -U teslamate teslamate > /backuplocation/teslamate.bck -bash: /backuplocation/teslamate.bck: No such file or directory pi@raspberrypi:~ $ docker-compose down ERROR: Couldn't connect to Docker daemon at http+docker://localhost - is it running? If it's at a non-standard location, specify the URL with the DOCKER_HOST environment variable. pi@raspberrypi:~ $ dir docker-compose.yml -v pi@raspberrypi:~ $ docker-compose exec -T database pg_dump -U teslamate teslamate ERROR: No such service: database pi@raspberrypi:~ $ docker-compose pull Pulling teslamate ... Pulling db ... Pulling grafana ... Pulling mosquitto ... ERROR: for teslamate ('Connection aborted.', PermissionError(13, 'Permission denied')) ERROR: for mosquitto ('Connection aborted.', PermissionError(13, 'Permission denied')) ERROR: for grafana ('Connection aborted.', PermissionError(13, 'Permission denied')) ERROR: for db ('Connection aborted.', PermissionError(13, 'Permission denied')) ERROR: Couldn't connect to Docker daemon at http+docker://localhost - is it running? If it's at a non-standard location, specify the URL with the DOCKER_HOST environment variable. pi@raspberrypi:~ $ docker-compose down ERROR: Couldn't connect to Docker daemon at http+docker://localhost - is it running? If it's at a non-standard location, specify the URL with the DOCKER_HOST environment variable. pi@raspberrypi:~ $ cd.. -bash: cd..: command not found pi@raspberrypi:~ $ dir docker-compose.yml -v pi@raspberrypi:~ $ list -bash: list: command not found pi@raspberrypi:~ $ docker-compose -h Define and run multi-container applications with Docker. Usage: docker-compose [-f <arg>...] [options] [COMMAND] [ARGS...] docker-compose -h|--help Options: -f, --file FILE Specify an alternate compose file (default: docker-compose.yml) -p, --project-name NAME Specify an alternate project name (default: directory name) --verbose Show more output --log-level LEVEL Set log level (DEBUG, INFO, WARNING, ERROR, CRITICAL) --no-ansi Do not print ANSI control characters -v, --version Print version and exit -H, --host HOST Daemon socket to connect to --tls Use TLS; implied by --tlsverify --tlscacert CA_PATH Trust certs signed only by this CA --tlscert CLIENT_CERT_PATH Path to TLS certificate file --tlskey TLS_KEY_PATH Path to TLS key file --tlsverify Use TLS and verify the remote --skip-hostname-check Don't check the daemon's hostname against the name specified in the client certificate --project-directory PATH Specify an alternate working directory (default: the path of the Compose file) --compatibility If set, Compose will attempt to convert deploy keys in v3 files to their non-Swarm equivalent Commands: build Build or rebuild services bundle Generate a Docker bundle from the Compose file config Validate and view the Compose file create Create services down Stop and remove containers, networks, images, and volumes events Receive real time events from containers exec Execute a command in a running container help Get help on a command images List images kill Kill containers logs View output from containers pause Pause services port Print the public port for a port binding ps List containers pull Pull service images push Push service images restart Restart services rm Remove stopped containers run Run a one-off command scale Set number of containers for a service start Start services stop Stop services top Display the running processes unpause Unpause services up Create and start containers version Show the Docker-Compose version information pi@raspberrypi:~ $ docker-compose down ERROR: Couldn't connect to Docker daemon at http+docker://localhost - is it running? If it's at a non-standard location, specify the URL with the DOCKER_HOST environment variable. pi@raspberrypi:~ $ docker-compose pull Pulling teslamate ... Pulling db ... Pulling grafana ... Pulling mosquitto ... ERROR: for teslamate ('Connection aborted.', PermissionError(13, 'Permission denied')) ERROR: for grafana ('Connection aborted.', PermissionError(13, 'Permission denied')) ERROR: for db ('Connection aborted.', PermissionError(13, 'Permission denied')) ERROR: for mosquitto ('Connection aborted.', PermissionError(13, 'Permission denied')) ERROR: Couldn't connect to Docker daemon at http+docker://localhost - is it running? If it's at a non-standard location, specify the URL with the DOCKER_HOST environment variable. pi@raspberrypi:~ $ docker-compose up -d ERROR: Couldn't connect to Docker daemon at http+docker://localhost - is it running? If it's at a non-standard location, specify the URL with the DOCKER_HOST environment variable. pi@raspberrypi:~ $
sudo groupadd docker
sudo usermod -aG docker $(whoami)
Thanks @Melved, I appreciate the input. Unfortunately it didn't work for me & I need more help...Please? I can really only confirm that Teslamate is continuing to run fine on my pi. The following is my session and what I am getting when I SS into my pi with Putty. I started off trying to run the backup, that didn't work, then I tried to run the update, that didn't work. Then I tried to see the help file, at least that seemed to have worked, but is useless for me. (And yes I did actually use some DOS commands in there as it is all that is left that I know how to do).:
Code:Linux raspberrypi 4.19.75-v7+ #1270 SMP Tue Sep 24 18:45:11 BST 2019 armv7l The programs included with the Debian GNU/Linux system are free software; the exact distribution terms for each program are described in the individual files in /usr/share/doc/*/copyright. Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent permitted by applicable law. Last login: Mon Oct 19 03:15:40 2020 from 192.168.1.13 pi@raspberrypi:~ $ docker-compose exec -T database pg_dump -U teslamate teslamate > /backuplocation/teslamate.bck -bash: /backuplocation/teslamate.bck: No such file or directory pi@raspberrypi:~ $ docker-compose down ERROR: Couldn't connect to Docker daemon at http+docker://localhost - is it running? If it's at a non-standard location, specify the URL with the DOCKER_HOST environment variable. pi@raspberrypi:~ $ dir docker-compose.yml -v pi@raspberrypi:~ $ docker-compose exec -T database pg_dump -U teslamate teslamate ERROR: No such service: database pi@raspberrypi:~ $ docker-compose pull Pulling teslamate ... Pulling db ... Pulling grafana ... Pulling mosquitto ... ERROR: for teslamate ('Connection aborted.', PermissionError(13, 'Permission denied')) ERROR: for mosquitto ('Connection aborted.', PermissionError(13, 'Permission denied')) ERROR: for grafana ('Connection aborted.', PermissionError(13, 'Permission denied')) ERROR: for db ('Connection aborted.', PermissionError(13, 'Permission denied')) ERROR: Couldn't connect to Docker daemon at http+docker://localhost - is it running? If it's at a non-standard location, specify the URL with the DOCKER_HOST environment variable. pi@raspberrypi:~ $ docker-compose down ERROR: Couldn't connect to Docker daemon at http+docker://localhost - is it running? If it's at a non-standard location, specify the URL with the DOCKER_HOST environment variable. pi@raspberrypi:~ $ cd.. -bash: cd..: command not found pi@raspberrypi:~ $ dir docker-compose.yml -v pi@raspberrypi:~ $ list -bash: list: command not found pi@raspberrypi:~ $ docker-compose -h Define and run multi-container applications with Docker. Usage: docker-compose [-f <arg>...] [options] [COMMAND] [ARGS...] docker-compose -h|--help Options: -f, --file FILE Specify an alternate compose file (default: docker-compose.yml) -p, --project-name NAME Specify an alternate project name (default: directory name) --verbose Show more output --log-level LEVEL Set log level (DEBUG, INFO, WARNING, ERROR, CRITICAL) --no-ansi Do not print ANSI control characters -v, --version Print version and exit -H, --host HOST Daemon socket to connect to --tls Use TLS; implied by --tlsverify --tlscacert CA_PATH Trust certs signed only by this CA --tlscert CLIENT_CERT_PATH Path to TLS certificate file --tlskey TLS_KEY_PATH Path to TLS key file --tlsverify Use TLS and verify the remote --skip-hostname-check Don't check the daemon's hostname against the name specified in the client certificate --project-directory PATH Specify an alternate working directory (default: the path of the Compose file) --compatibility If set, Compose will attempt to convert deploy keys in v3 files to their non-Swarm equivalent Commands: build Build or rebuild services bundle Generate a Docker bundle from the Compose file config Validate and view the Compose file create Create services down Stop and remove containers, networks, images, and volumes events Receive real time events from containers exec Execute a command in a running container help Get help on a command images List images kill Kill containers logs View output from containers pause Pause services port Print the public port for a port binding ps List containers pull Pull service images push Push service images restart Restart services rm Remove stopped containers run Run a one-off command scale Set number of containers for a service start Start services stop Stop services top Display the running processes unpause Unpause services up Create and start containers version Show the Docker-Compose version information pi@raspberrypi:~ $ docker-compose down ERROR: Couldn't connect to Docker daemon at http+docker://localhost - is it running? If it's at a non-standard location, specify the URL with the DOCKER_HOST environment variable. pi@raspberrypi:~ $ docker-compose pull Pulling teslamate ... Pulling db ... Pulling grafana ... Pulling mosquitto ... ERROR: for teslamate ('Connection aborted.', PermissionError(13, 'Permission denied')) ERROR: for grafana ('Connection aborted.', PermissionError(13, 'Permission denied')) ERROR: for db ('Connection aborted.', PermissionError(13, 'Permission denied')) ERROR: for mosquitto ('Connection aborted.', PermissionError(13, 'Permission denied')) ERROR: Couldn't connect to Docker daemon at http+docker://localhost - is it running? If it's at a non-standard location, specify the URL with the DOCKER_HOST environment variable. pi@raspberrypi:~ $ docker-compose up -d ERROR: Couldn't connect to Docker daemon at http+docker://localhost - is it running? If it's at a non-standard location, specify the URL with the DOCKER_HOST environment variable. pi@raspberrypi:~ $
Sounds like it could be a permission issue. Check that the pi user is in the docker group by running the following: groups
If you don't see docker in the reply, you will need to add the user to the group, if it exists, by running the below:
Code:sudo groupadd docker sudo usermod -aG docker $(whoami)
You may have to log out of the pi and ssh back in again for it to work then run the following to see if that worked: docker images
If that still doesn't work, you may need to install docker.
Thank you@Spydaw & @Melved. It told me that the group docker was already existing after I typed "sudo groupadd docker". So I tried
"sudo usermod -aG docker $(whoami)" & I still got an error. But then I logged out, logged back in, and used the lines
"
docker-compose down
docker-compose pull
docker-compose up -d", and they seem to have worked this time. I can now confirm I am running 1.20.0. Now I have to see about learning to properly backing this thing up. I suppose it was a bit risky this way but I couldn't get the backup or the update to actually update. Thanks again.....
Stranger and stranger...
So, this morning I’ve got an automated backup.
The cron job is this:
* 2 * * * /home/pi/tmbackup/tmbackup.sh
but the files on both the Pi and Google drive are timed at 0259!
So it worked, but why is the time so late? A manual backup and Google upload takes 3 or 4 minutes.
Mine are at 3am after following your guide. Wonder if it's a UTC/BST issue?Well I'm glad it's working, but the timing I'm not sure on. Just checked mine and it's 4am on the dot! (only a 59mb file though)
I’m glad you’re puzzled too My file is now 138MB, but all the previous ones that worked were at 3am, as per your example cron. I changed it to 2am just in case something funny was happening at my end at 3am to stop it working. At least it’s working now! Thanks for all your help @DaveWWell I'm glad it's working, but the timing I'm not sure on. Just checked mine and it's 4am on the dot! (only a 59mb file though)
Mine are at 3am after following your guide. Wonder if it's a UTC/BST issue?
I’m glad you’re puzzled too My file is now 138MB, but all the previous ones that worked were at 3am, as per your example cron. I changed it to 2am just in case something funny was happening at my end at 3am to stop it working. At least it’s working now! Thanks for all your help @DaveW
Thanks @DaveW. I'm going to study this and give it a go...That makes sense, I think it says once you change the permissions (with the second statement) that you need to login for it to take affect.
I've put something together for an automated backup to Google Drive if that helps?
How to perform an automated TeslaMate backup to Google Drive
It's working again?Does anyone know if GCP is now stable again?
AS 'SELECT public.cube(public.cube(public.cube(public.earth()*cos(radians(\$1))*cos(radians(\$2))),public.earth()*cos(radians(\$1))*sin(radians(\$2))),public.earth()*sin(radians(\$1)))::public.earth';
AS 'SELECT public.cube(public.cube(public.cube(public.earth()*cos(radians($1))*cos(radians($2))),public.earth()*cos(radians($1))*sin(radians($2))),public.earth()*sin(radians($1)))::public.earth';