{"action":"created","issue":{"url":"https://api.github.com/repos/dashpay/dash/issues/306","labels_url":"https://api.github.com/repos/dashpay/dash/issues/306/labels{/name}","comments_url":"https://api.github.com/repos/dashpay/dash/issues/306/comments","events_url":"https://api.github.com/repos/dashpay/dash/issues/306/events","html_url":"https://github.com/dashpay/dash/pull/306","id":67916050,"number":306,"title":"Configurable Automatic Wallet Backup","user":{"login":"crowning-","id":10080039,"avatar_url":"https://avatars.githubusercontent.com/u/10080039?v=3","gravatar_id":"","url":"https://api.github.com/users/crowning-","html_url":"https://github.com/crowning-","followers_url":"https://api.github.com/users/crowning-/followers","following_url":"https://api.github.com/users/crowning-/following{/other_user}","gists_url":"https://api.github.com/users/crowning-/gists{/gist_id}","starred_url":"https://api.github.com/users/crowning-/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crowning-/subscriptions","organizations_url":"https://api.github.com/users/crowning-/orgs","repos_url":"https://api.github.com/users/crowning-/repos","events_url":"https://api.github.com/users/crowning-/events{/privacy}","received_events_url":"https://api.github.com/users/crowning-/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-04-12T13:36:56Z","updated_at":"2015-04-12T14:59:26Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/dashpay/dash/pulls/306","html_url":"https://github.com/dashpay/dash/pull/306","diff_url":"https://github.com/dashpay/dash/pull/306.diff","patch_url":"https://github.com/dashpay/dash/pull/306.patch"},"body":"Reference: https://dashtalk.org/threads/v0-11-2-x-testing.4202/page-37#post-50915\r\n\r\nI have implemented automatic wallet backups so in case wallet.dat gets corrupted beyond repair the user has the possibility to restore the file from one of the backups.\r\n\r\nHow it works:\r\n1. new parameter *-createwalletbackups=n*  with 0 <= n <= 10, default: 10 (Number of backups)\r\n2. a folder \"backups\" is created in the folder where wallet.dat normally is\r\n3. during the start of the wallet (before wallet.dat is used by the application) a copy of wallet.dat is created in this folder with the name wallet.dat.+timestamp. This is logged to debug.log\r\n4. if there are more than \"n\" backups the oldest ones are deleted (also logged)\r\n5. the minimum interval between backups is 1 minute\r\n6. *createwalletbackups=0* disables backups, but keeps existing ones in the \"backups\" folder\r\n7. new menu \"Tools->Show Automatic Backups\" opens the operation-system's default file-browser and shows the files and allows the user to copy them somewhere else.\r\n8. I have added a new icon \"browse.png\" to the resources. Right now it's identical to the \"filesave\" icon, but can easily be replaced when someone comes up with something better.\r\n\r\nTests are done under several flavours of Linux, Windows (by yours truly) and OSX (thanks @UdjinM6 :thumbsup:), and it builds with Gitian without problems.\r\n\r\nBy default automatic backups are switch ON and set to 10 backups. My reasoning behind this (instead of having it OFF by default):\r\n* Users who already know what they are doing know how to switch it off. The also know how to make a backup \"by hand\", so they are not the target group.\r\n* Newbs who have no idea what they are doing are the ones which need a backup most when things go South. And they won't switch it on until explicitly told so. Search for threads (currency-independent) on BCT where users lost/corrupted their wallets...almost always beginners.\r\n* Disk-space is cheap, Dash not.\r\n\r\nThis is how it looks UI-wise:\r\n![backups](https://cloud.githubusercontent.com/assets/10080039/7105767/9e647fb4-e129-11e4-9e52-0bc341982fbe.png)\r\n\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/dashpay/dash/issues/comments/92076828","html_url":"https://github.com/dashpay/dash/pull/306#issuecomment-92076828","issue_url":"https://api.github.com/repos/dashpay/dash/issues/306","id":92076828,"user":{"login":"UdjinM6","id":1935069,"avatar_url":"https://avatars.githubusercontent.com/u/1935069?v=3","gravatar_id":"","url":"https://api.github.com/users/UdjinM6","html_url":"https://github.com/UdjinM6","followers_url":"https://api.github.com/users/UdjinM6/followers","following_url":"https://api.github.com/users/UdjinM6/following{/other_user}","gists_url":"https://api.github.com/users/UdjinM6/gists{/gist_id}","starred_url":"https://api.github.com/users/UdjinM6/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/UdjinM6/subscriptions","organizations_url":"https://api.github.com/users/UdjinM6/orgs","repos_url":"https://api.github.com/users/UdjinM6/repos","events_url":"https://api.github.com/users/UdjinM6/events{/privacy}","received_events_url":"https://api.github.com/users/UdjinM6/received_events","type":"User","site_admin":false},"created_at":"2015-04-12T14:59:26Z","updated_at":"2015-04-12T14:59:26Z","body":"Tested and works as expected on Mac OS X 10.10.3\r\n\r\nGreat job! :+1: "}}