{"id":20150337,"url":"https://github.com/fantasyflip/supabase-gffs-backup","last_synced_at":"2026-04-12T09:03:33.237Z","repository":{"id":226734106,"uuid":"769514516","full_name":"fantasyflip/supabase-gffs-backup","owner":"fantasyflip","description":"A python script, when run daily via a cronjob, resulting in a grandfather-father-son backup scheme for supabase databases - w/ @Stefcrash","archived":false,"fork":false,"pushed_at":"2024-03-10T19:47:27.000Z","size":2,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-03T00:44:25.505Z","etag":null,"topics":["backup","database","gffs","postgres","supabase"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fantasyflip.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-03-09T09:47:02.000Z","updated_at":"2024-12-27T16:07:00.000Z","dependencies_parsed_at":"2024-11-14T00:15:33.684Z","dependency_job_id":null,"html_url":"https://github.com/fantasyflip/supabase-gffs-backup","commit_stats":null,"previous_names":["fantasyflip/supabase-backup","fantasyflip/supabase-gffs-backup"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/fantasyflip/supabase-gffs-backup","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fantasyflip%2Fsupabase-gffs-backup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fantasyflip%2Fsupabase-gffs-backup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fantasyflip%2Fsupabase-gffs-backup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fantasyflip%2Fsupabase-gffs-backup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fantasyflip","download_url":"https://codeload.github.com/fantasyflip/supabase-gffs-backup/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fantasyflip%2Fsupabase-gffs-backup/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268282014,"owners_count":24225160,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-01T02:00:08.611Z","response_time":67,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["backup","database","gffs","postgres","supabase"],"created_at":"2024-11-13T22:51:38.830Z","updated_at":"2026-04-12T09:03:33.198Z","avatar_url":"https://github.com/fantasyflip.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Supabase Database Backup Script\n\n## Overview\nThis Python script is designed to automate the backup process for Supabase databases using a grandfather-father-son backup scheme. By running this script daily through a cronjob, it ensures the creation of regular backups and organizes them into daily, weekly, and monthly folders. The backup files are stored in the specified root path, and the script provides detailed logging for monitoring the backup process.\n\n## Features\n- **Grandfather-Father-Son Backup Scheme:** The script organizes backups into daily, weekly, and monthly folders to maintain a historical backup record.\n- **Flexible Configuration:** Easily configure the script by adding or modifying database details in the `databases` array, including database name, user, Supabase subdomain ID, password, and dump file name.\n- **Automatic Backup:** The script automatically pulls database dumps, organizes them into appropriate folders, and maintains the specified number of backups for each timeframe (daily, weekly, and monthly).\n- **Logging:** Detailed logging is implemented, recording each step of the backup process. The log file is located at `/mnt/supabase-backup/supabase-backup.log` by default.\n\n## Prerequisites\n- Ensure Python 3 is installed on your system.\n- Set up a cronjob to run the script daily.\n\n## Configuration\n1. Open the script and navigate to the `databases` array.\n2. Add your Supabase databases with the required details, such as name, user, Supabase subdomain ID, password, and dump file name.\n\n```python\ndatabases = [\n    {\n        \"name\": \"Database-A\",\n        \"user\": \"postgres\",\n        \"id\": \"abcdefg\",\n        \"password\": \"xxxxxxxx\",\n        \"dumpName\": \"db-a-dump.sql\"\n    },\n    # Add more databases as needed\n]\n```\n\n## Usage\n\n1. Make the script executable:\n\n```bash\nchmod +x /path/to/backup_script.py\n```\n\n2. Set up a cronjob to run the script daily. Example:\n\n```bash\n0 0 * * * /path/to/backup_script.py\n```\n\nThis example runs the script every day at midnight.\n\n## Monitoring\nCheck the log file at `/mnt/supabase-backup/supabase-backup.log` for detailed information on each backup process. Monitor this log to ensure the script is running successfully and backups are being created and organized accordingly.\n\n**Note:** Make sure to secure the script and log files appropriately to prevent unauthorized access.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffantasyflip%2Fsupabase-gffs-backup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffantasyflip%2Fsupabase-gffs-backup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffantasyflip%2Fsupabase-gffs-backup/lists"}