{"action":"created","issue":{"url":"https://api.github.com/repos/kr/beanstalkd/issues/206","repository_url":"https://api.github.com/repos/kr/beanstalkd","labels_url":"https://api.github.com/repos/kr/beanstalkd/issues/206/labels{/name}","comments_url":"https://api.github.com/repos/kr/beanstalkd/issues/206/comments","events_url":"https://api.github.com/repos/kr/beanstalkd/issues/206/events","html_url":"https://github.com/kr/beanstalkd/issues/206","id":20107792,"number":206,"title":"Possible problem with `-b` option...","user":{"login":"m1ksoftware","id":4330030,"avatar_url":"https://avatars.githubusercontent.com/u/4330030?v=3","gravatar_id":"","url":"https://api.github.com/users/m1ksoftware","html_url":"https://github.com/m1ksoftware","followers_url":"https://api.github.com/users/m1ksoftware/followers","following_url":"https://api.github.com/users/m1ksoftware/following{/other_user}","gists_url":"https://api.github.com/users/m1ksoftware/gists{/gist_id}","starred_url":"https://api.github.com/users/m1ksoftware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/m1ksoftware/subscriptions","organizations_url":"https://api.github.com/users/m1ksoftware/orgs","repos_url":"https://api.github.com/users/m1ksoftware/repos","events_url":"https://api.github.com/users/m1ksoftware/events{/privacy}","received_events_url":"https://api.github.com/users/m1ksoftware/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2013-09-26T12:57:48Z","updated_at":"2016-04-03T17:07:44Z","closed_at":null,"body":"If Beanstalkd is started with the `-b` option (which I'll call session 1), then restarted without `-b` option (session 2) and, again, restarted with `-b` option (session 3), it will reload jobs from session 1. In some cases, this could be ok, in others not.\r\nMaybe could be useful to have a new option (`-B` ?) to clear past existing logs (if they exist). So, using `-B`: \r\n\r\n```\r\n( binlog_exists ) ? clear_binlog_and_start_with_b_option : start_with_b_option\r\n```\r\n\r\nWhat do you think about? I'd need this feature :) and...I could work on it if you think that it might be interesting."},"comment":{"url":"https://api.github.com/repos/kr/beanstalkd/issues/comments/205010601","html_url":"https://github.com/kr/beanstalkd/issues/206#issuecomment-205010601","issue_url":"https://api.github.com/repos/kr/beanstalkd/issues/206","id":205010601,"user":{"login":"JensRantil","id":730342,"avatar_url":"https://avatars.githubusercontent.com/u/730342?v=3","gravatar_id":"","url":"https://api.github.com/users/JensRantil","html_url":"https://github.com/JensRantil","followers_url":"https://api.github.com/users/JensRantil/followers","following_url":"https://api.github.com/users/JensRantil/following{/other_user}","gists_url":"https://api.github.com/users/JensRantil/gists{/gist_id}","starred_url":"https://api.github.com/users/JensRantil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JensRantil/subscriptions","organizations_url":"https://api.github.com/users/JensRantil/orgs","repos_url":"https://api.github.com/users/JensRantil/repos","events_url":"https://api.github.com/users/JensRantil/events{/privacy}","received_events_url":"https://api.github.com/users/JensRantil/received_events","type":"User","site_admin":false},"created_at":"2016-04-03T17:07:44Z","updated_at":"2016-04-03T17:07:44Z","body":"I think that's a very scary option. Someone being a little sloppy could easily use `-B` instead of `-b`, running beanstalk for a week, restart it and suddenly loose _all_ jobs previously queued. I suggest you instead use a script to start beanstalk, something like this:\r\n\r\n```bash\r\n#!/bin/bash\r\nBINLOG=/path/to/binlog\r\nrm -fr $BINLOG/*\r\nbeanstalkd -b $BINLOG\r\n```\r\n\r\n@m1ksoftware Would this be a reasonable workaround?"}}