{"action":"created","issue":{"url":"https://api.github.com/repos/firefly-iii/firefly-iii/issues/1829","repository_url":"https://api.github.com/repos/firefly-iii/firefly-iii","labels_url":"https://api.github.com/repos/firefly-iii/firefly-iii/issues/1829/labels{/name}","comments_url":"https://api.github.com/repos/firefly-iii/firefly-iii/issues/1829/comments","events_url":"https://api.github.com/repos/firefly-iii/firefly-iii/issues/1829/events","html_url":"https://github.com/firefly-iii/firefly-iii/issues/1829","id":374755024,"node_id":"MDU6SXNzdWUzNzQ3NTUwMjQ=","number":1829,"title":"Creating a backup script","user":{"login":"NanneHuiges","id":1526794,"node_id":"MDQ6VXNlcjE1MjY3OTQ=","avatar_url":"https://avatars0.githubusercontent.com/u/1526794?v=4","gravatar_id":"","url":"https://api.github.com/users/NanneHuiges","html_url":"https://github.com/NanneHuiges","followers_url":"https://api.github.com/users/NanneHuiges/followers","following_url":"https://api.github.com/users/NanneHuiges/following{/other_user}","gists_url":"https://api.github.com/users/NanneHuiges/gists{/gist_id}","starred_url":"https://api.github.com/users/NanneHuiges/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NanneHuiges/subscriptions","organizations_url":"https://api.github.com/users/NanneHuiges/orgs","repos_url":"https://api.github.com/users/NanneHuiges/repos","events_url":"https://api.github.com/users/NanneHuiges/events{/privacy}","received_events_url":"https://api.github.com/users/NanneHuiges/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-10-28T13:39:37Z","updated_at":"2018-10-28T14:53:20Z","closed_at":null,"author_association":"NONE","body":"For my own install I created a backupscript to get the information out of the volumes and get them in to a (for me) easier te manage format. Basically I added a mounted dir to the composer file, and created a script that runs a backup copy of files and a dump of the database. Nothing special.\r\n\r\nWould this be interesting to make an MR for e.g. the documentation? I'm not sure it's the intended usage or that everyone would think this is the best way, as you could obviously backup the volumes from the docker eco-system, and it does involve editing the docker-compose file.\r\n\r\nIt needs a bit of a polish which I will do if you'd think its interesting to put somewhere?\r\n\r\n```\r\n#!/bin/bash\r\n#\r\n# Backup script for firefly installations that were installed using the method\r\n# 'Docker Hub with automatic updates via docker compose'\r\n#\r\n# Makes a main backup directory inside the current dir,\r\n# and a subdirectory for each day (Ymd).\r\n# within that subdirectory each run will create a db-file and\r\n# 2 directories (export/upload), named with date/time (YmdHMS)\r\n#\r\n# author: Nanne Huiges (nanne@huiges.nl)\r\n\r\n# verbose: shows commands for debugging\r\n# set -x\r\n\r\n#############################################\r\n############### settings ####################\r\n#############################################\r\n# db-container name (from docker-compose file)\r\nDB_CONTAINER=\"firefly_iii_db\"\r\nAPP_CONTAINER=\"firefly_iii_app\"\r\n\r\n# db name (from docker-compose file)\r\nDB_USER=\"firefly\"\r\n\r\n# backup locations\r\nBACKUP_SUBDIR=\"$(date +%Y%m%d)\"\r\nDB_BACKUP_FILE=\"firefly_db_$(date +%Y%m%d%H%M%S)\"\r\nUPLOADS_SUBDIR=\"upload_$(date +%Y%m%d%H%M%S)\"\r\nEXPORTS_SUBDIR=\"export_$(date +%Y%m%d%H%M%S)\"\r\n\r\n#############################################\r\n############### actual script ###############\r\n#############################################\r\n\r\nmkdir -p ./backup/${BACKUP_SUBDIR}\r\nmkdir -p ./backup/${BACKUP_SUBDIR}/${EXPORTS_SUBDIR}\r\nmkdir -p ./backup/${BACKUP_SUBDIR}/${UPLOADS_SUBDIR}\r\n\r\ndocker-compose exec -T ${DB_CONTAINER} bash -c  'pg_dump -U '${DB_USER}' | gzip >/backup/'${BACKUP_SUBDIR}'/'${DB_BACKUP_FILE}.sql.gz''\r\n\r\ndocker-compose exec -T ${APP_CONTAINER} bash -c  'cp /var/www/firefly-iii/storage/export/* /backup/'${BACKUP_SUBDIR}'/'${EXPORTS_SUBDIR}'/'\r\n\r\ndocker-compose exec -T ${APP_CONTAINER} bash -c  'cp /var/www/firefly-iii/storage/upload/* /backup/'${BACKUP_SUBDIR}'/'${UPLOADS_SUBDIR}'/'\r\n```\r\n\r\nAs said, it's nothing fancy but it helps to create backups if you want them in a simple format for emergies."},"comment":{"url":"https://api.github.com/repos/firefly-iii/firefly-iii/issues/comments/433712618","html_url":"https://github.com/firefly-iii/firefly-iii/issues/1829#issuecomment-433712618","issue_url":"https://api.github.com/repos/firefly-iii/firefly-iii/issues/1829","id":433712618,"node_id":"MDEyOklzc3VlQ29tbWVudDQzMzcxMjYxOA==","user":{"login":"JC5","id":5889984,"node_id":"MDQ6VXNlcjU4ODk5ODQ=","avatar_url":"https://avatars0.githubusercontent.com/u/5889984?v=4","gravatar_id":"","url":"https://api.github.com/users/JC5","html_url":"https://github.com/JC5","followers_url":"https://api.github.com/users/JC5/followers","following_url":"https://api.github.com/users/JC5/following{/other_user}","gists_url":"https://api.github.com/users/JC5/gists{/gist_id}","starred_url":"https://api.github.com/users/JC5/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JC5/subscriptions","organizations_url":"https://api.github.com/users/JC5/orgs","repos_url":"https://api.github.com/users/JC5/repos","events_url":"https://api.github.com/users/JC5/events{/privacy}","received_events_url":"https://api.github.com/users/JC5/received_events","type":"User","site_admin":false},"created_at":"2018-10-28T14:53:20Z","updated_at":"2018-10-28T14:53:20Z","author_association":"MEMBER","body":"This is absolutely useful, although the repository would not be the best place.\r\n\r\nIf you create a [Gist](https://gist.github.com/), I can link to it from the documentation. If people run into problems they can comment and leave suggestions. Would that be a good idea?"}}
{"actor":{"display_login":"JC5"}}