Skip to content

Instantly share code, notes, and snippets.

@dongbum
Last active December 12, 2023 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dongbum/57980067d164df9920e905f17d1d5f3c to your computer and use it in GitHub Desktop.
Save dongbum/57980067d164df9920e905f17d1d5f3c to your computer and use it in GitHub Desktop.
teslamate backup script
#!/bin/bash
today=$(date "+%Y%m%d")
now=$(date "+%H%M%S")
docker-compose exec -T database pg_dump -U teslamate teslamate > /disk1/backup/teslamate/teslamate_${today}_${now}.backup
chown viper9:users /disk1/backup/teslamate/teslamate_${today}.backup
echo "Backup complete."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment