{"action":"created","issue":{"url":"https://api.github.com/repos/jens-maus/yam/issues/133","repository_url":"https://api.github.com/repos/jens-maus/yam","labels_url":"https://api.github.com/repos/jens-maus/yam/issues/133/labels{/name}","comments_url":"https://api.github.com/repos/jens-maus/yam/issues/133/comments","events_url":"https://api.github.com/repos/jens-maus/yam/issues/133/events","html_url":"https://github.com/jens-maus/yam/issues/133","id":148641224,"number":133,"title":"Integrate an automatic index backup mechanism","user":{"login":"jens-maus","id":5887769,"avatar_url":"https://avatars.githubusercontent.com/u/5887769?v=3","gravatar_id":"","url":"https://api.github.com/users/jens-maus","html_url":"https://github.com/jens-maus","followers_url":"https://api.github.com/users/jens-maus/followers","following_url":"https://api.github.com/users/jens-maus/following{/other_user}","gists_url":"https://api.github.com/users/jens-maus/gists{/gist_id}","starred_url":"https://api.github.com/users/jens-maus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jens-maus/subscriptions","organizations_url":"https://api.github.com/users/jens-maus/orgs","repos_url":"https://api.github.com/users/jens-maus/repos","events_url":"https://api.github.com/users/jens-maus/events{/privacy}","received_events_url":"https://api.github.com/users/jens-maus/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/jens-maus/yam/labels/%23major","name":"#major","color":"ededed"},{"url":"https://api.github.com/repos/jens-maus/yam/labels/@normal","name":"@normal","color":"ededed"},{"url":"https://api.github.com/repos/jens-maus/yam/labels/MIME","name":"MIME","color":"ededed"},{"url":"https://api.github.com/repos/jens-maus/yam/labels/task","name":"task","color":"ededed"},{"url":"https://api.github.com/repos/jens-maus/yam/labels/wontfix","name":"wontfix","color":"ffffff"}],"state":"closed","locked":false,"assignee":{"login":"jens-maus","id":5887769,"avatar_url":"https://avatars.githubusercontent.com/u/5887769?v=3","gravatar_id":"","url":"https://api.github.com/users/jens-maus","html_url":"https://github.com/jens-maus","followers_url":"https://api.github.com/users/jens-maus/followers","following_url":"https://api.github.com/users/jens-maus/following{/other_user}","gists_url":"https://api.github.com/users/jens-maus/gists{/gist_id}","starred_url":"https://api.github.com/users/jens-maus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jens-maus/subscriptions","organizations_url":"https://api.github.com/users/jens-maus/orgs","repos_url":"https://api.github.com/users/jens-maus/repos","events_url":"https://api.github.com/users/jens-maus/events{/privacy}","received_events_url":"https://api.github.com/users/jens-maus/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/jens-maus/yam/milestones/1","html_url":"https://github.com/jens-maus/yam/milestones/YAM%202.7","labels_url":"https://api.github.com/repos/jens-maus/yam/milestones/1/labels","id":1708702,"number":1,"title":"YAM 2.7","description":"[[TicketQuery(milestone=YAM 2.7, order=resolution, desc=1, format=table, col=id|type|status|resolution|priority|summary)]]","creator":{"login":"jens-maus","id":5887769,"avatar_url":"https://avatars.githubusercontent.com/u/5887769?v=3","gravatar_id":"","url":"https://api.github.com/users/jens-maus","html_url":"https://github.com/jens-maus","followers_url":"https://api.github.com/users/jens-maus/followers","following_url":"https://api.github.com/users/jens-maus/following{/other_user}","gists_url":"https://api.github.com/users/jens-maus/gists{/gist_id}","starred_url":"https://api.github.com/users/jens-maus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jens-maus/subscriptions","organizations_url":"https://api.github.com/users/jens-maus/orgs","repos_url":"https://api.github.com/users/jens-maus/repos","events_url":"https://api.github.com/users/jens-maus/events{/privacy}","received_events_url":"https://api.github.com/users/jens-maus/received_events","type":"User","site_admin":false},"open_issues":0,"closed_issues":33,"state":"closed","created_at":"2016-04-15T10:18:45Z","updated_at":"2016-04-15T11:52:59Z","due_on":"2011-12-19T23:00:00Z","closed_at":"2016-04-15T10:18:45Z"},"comments":3,"created_at":"2016-04-15T11:52:50Z","updated_at":"2016-04-15T11:52:59Z","closed_at":"2016-04-15T11:52:59Z","body":"**Originally on 2010-03-06 00:48:35 +0100**\n\n___\nIt might be worth to implement a kinda automatic index backup mechanism. This mechanism should e.g. automatically rename an index file right before regenerating an index or even before every write operation of an index file. (e.g. rename it to .index.bakX where X stands for a counter).\n\nThen if an operation failed or if an index rebuild was aborted by the user the latest backup can be restored and the old index being used from now on.\n\nHowever, this mechanism would probably require a new index version as an index might have to contain a variable where the total amount of mails and a kind of checksum is stored, hence the scheduled task for 2.7+"},"comment":{"url":"https://api.github.com/repos/jens-maus/yam/issues/comments/210436730","html_url":"https://github.com/jens-maus/yam/issues/133#issuecomment-210436730","issue_url":"https://api.github.com/repos/jens-maus/yam/issues/133","id":210436730,"user":{"login":"jens-maus","id":5887769,"avatar_url":"https://avatars.githubusercontent.com/u/5887769?v=3","gravatar_id":"","url":"https://api.github.com/users/jens-maus","html_url":"https://github.com/jens-maus","followers_url":"https://api.github.com/users/jens-maus/followers","following_url":"https://api.github.com/users/jens-maus/following{/other_user}","gists_url":"https://api.github.com/users/jens-maus/gists{/gist_id}","starred_url":"https://api.github.com/users/jens-maus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jens-maus/subscriptions","organizations_url":"https://api.github.com/users/jens-maus/orgs","repos_url":"https://api.github.com/users/jens-maus/repos","events_url":"https://api.github.com/users/jens-maus/events{/privacy}","received_events_url":"https://api.github.com/users/jens-maus/received_events","type":"User","site_admin":false},"created_at":"2016-04-15T11:52:58Z","updated_at":"2016-04-15T11:52:58Z","body":"**Originally by @tboeckel on 2011-01-21 15:17:45 +0100**\n\n___\nAlthough I was quite optimistic when I did my test I must say I have come to the conclusion that an automatic index back mechanism cannot work.\n\nThe reason is quite simple. When YAM \"expires\" a folder's index it deletes the corresponding .index file. The backup mechanism would save this file to be able to restore it later in case the new .index file is found invalid/corrupted/missing. But here is the pitfall. When YAM has to expire an index this happens because the information in the saved index file is no longer valid, because a mail file has been renamed (note: we store the mail status in the mail's file name). But this also means that restoring a backed up index file will not be successful either, because the old index file will contain the old mail file name and hence inconsistent information would be restored, which is even worse.\n\nThus, from my point of view the suggested backup mechanism cannot work. At least I don't know how to implement it and make it work in such a way that rescans will be avoided.\n\nDoes anybody have a better idea?"}}