{"action":"created","comment":{"url":"https://api.github.com/repos/Katello/katello-packaging/pulls/comments/50322412","id":50322412,"diff_hunk":"@@ -3,77 +3,86 @@\n require 'optparse'\n require 'fileutils'\n \n+@options = {}\n+@dir = nil\n+\n optparse = OptionParser.new do |opts|\n   opts.banner = \"Usage: katello-backup /path/to/dir [options]\\n eg: $ katello-backup /tmp/katello-backup\"\n-end\n \n-optparse.parse!\n-\n-DIR = ARGV.pop\n-if DIR.nil?\n-  puts \"**** ERROR: Please specify an export directory ****\"\n-  puts optparse\n-  exit(-1)\n-else\n-  FileUtils.mkdir_p(DIR)\n-  puts \"Creating backup folder #{DIR}\"\n-  FileUtils.chown(nil, 'postgres', DIR)\n-  FileUtils.chmod 0770, DIR\n-  FileUtils.cd DIR\n-\n-  `katello-service stop`\n-  `service postgresql stop`\n-\n-  CONFIGS=[\n-    '/etc/candlepin',\n-    '/etc/foreman',\n-    '/etc/foreman-proxy',\n-    '/etc/gutterball',\n-    '/etc/hammer',\n-    '/etc/httpd',\n-    '/etc/katello',\n-    '/etc/katello-installer',\n-    '/etc/pki/content',\n-    '/etc/pki/katello',\n-    '/etc/pki/katello-certs-tools',\n-    '/etc/pki/pulp',\n-    '/etc/pki/tls/certs/katello-node.crt',\n-    '/etc/pki/tls/certs/pulp_consumers_ca.crt',\n-    '/etc/pki/tls/certs/pulp_ssl_cert.crt',\n-    '/etc/pki/tls/private/katello-node.key',\n-    '/etc/pulp',\n-    '/etc/puppet',\n-    '/etc/qpid',\n-    '/etc/qpid-dispatch',\n-    '/etc/sysconfig/tomcat*',\n-    '/etc/tomcat*',\n-    '/root/ssl-build',\n-    '/var/lib/foreman',\n-    '/var/lib/katello',\n-    '/var/lib/candlepin',\n-    '/var/www/html/pub',\n-    '/var/lib/puppet/foreman_cache_data',\n-    '/var/lib/puppet/ssl'\n-  ]\n-\n-  puts \"Backing up config files... \"\n-  `tar --selinux -czf config_files.tar.gz #{CONFIGS.join(' ')}`\n-  puts \"Done.\"\n-\n-  puts \"Backing up Pulp data... \"\n-  `tar --selinux -cf pulp_data.tar /var/lib/pulp/ /var/www/pub/`\n-  puts \"Done.\"\n-\n-  puts \"Backing up postgres db... \"\n-  `tar --selinux -czf pgsql_data.tar.gz /var/lib/pgsql/data/`\n-  puts \"Done.\"\n-\n-  puts \"Backing up mongo db... \"\n-  `tar --selinux -czf mongo_data.tar.gz --exclude=mongod.lock /var/lib/mongodb/`\n-  puts \"Done.\"\n-\n-  `service postgresql start`\n-  `katello-service start`\n-\n-  puts \"**** BACKUP Complete, contents can be found in: #{DIR} ****\"\n+  opts.on(\"--skip-pulp\", \"Backup everything but the pulp database\") do |skip_pulp|","path":"katello/katello-backup","position":80,"original_position":80,"commit_id":"f4c565d8792ed7640c11034ed72cf03d763c4a3e","original_commit_id":"f4c565d8792ed7640c11034ed72cf03d763c4a3e","user":{"login":"ehelms","id":293363,"avatar_url":"https://avatars.githubusercontent.com/u/293363?v=3","gravatar_id":"","url":"https://api.github.com/users/ehelms","html_url":"https://github.com/ehelms","followers_url":"https://api.github.com/users/ehelms/followers","following_url":"https://api.github.com/users/ehelms/following{/other_user}","gists_url":"https://api.github.com/users/ehelms/gists{/gist_id}","starred_url":"https://api.github.com/users/ehelms/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ehelms/subscriptions","organizations_url":"https://api.github.com/users/ehelms/orgs","repos_url":"https://api.github.com/users/ehelms/repos","events_url":"https://api.github.com/users/ehelms/events{/privacy}","received_events_url":"https://api.github.com/users/ehelms/received_events","type":"User","site_admin":false},"body":"Do you mean Pulp content here? I see mongodb is backed up which is the database.","created_at":"2016-01-20T21:31:21Z","updated_at":"2016-01-20T21:31:21Z","html_url":"https://github.com/Katello/katello-packaging/pull/145#discussion_r50322412","pull_request_url":"https://api.github.com/repos/Katello/katello-packaging/pulls/145","_links":{"self":{"href":"https://api.github.com/repos/Katello/katello-packaging/pulls/comments/50322412"},"html":{"href":"https://github.com/Katello/katello-packaging/pull/145#discussion_r50322412"},"pull_request":{"href":"https://api.github.com/repos/Katello/katello-packaging/pulls/145"}}},"pull_request":{"url":"https://api.github.com/repos/Katello/katello-packaging/pulls/145","id":56669300,"html_url":"https://github.com/Katello/katello-packaging/pull/145","diff_url":"https://github.com/Katello/katello-packaging/pull/145.diff","patch_url":"https://github.com/Katello/katello-packaging/pull/145.patch","issue_url":"https://api.github.com/repos/Katello/katello-packaging/issues/145","number":145,"state":"open","locked":false,"title":"fixes #13300 - allows backing up without pulp","user":{"login":"cfouant","id":5577256,"avatar_url":"https://avatars.githubusercontent.com/u/5577256?v=3","gravatar_id":"","url":"https://api.github.com/users/cfouant","html_url":"https://github.com/cfouant","followers_url":"https://api.github.com/users/cfouant/followers","following_url":"https://api.github.com/users/cfouant/following{/other_user}","gists_url":"https://api.github.com/users/cfouant/gists{/gist_id}","starred_url":"https://api.github.com/users/cfouant/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cfouant/subscriptions","organizations_url":"https://api.github.com/users/cfouant/orgs","repos_url":"https://api.github.com/users/cfouant/repos","events_url":"https://api.github.com/users/cfouant/events{/privacy}","received_events_url":"https://api.github.com/users/cfouant/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-01-20T21:23:37Z","updated_at":"2016-01-20T21:31:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"75d8b6588321ad9f9744211a5f45c03a8c3ece3e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Katello/katello-packaging/pulls/145/commits","review_comments_url":"https://api.github.com/repos/Katello/katello-packaging/pulls/145/comments","review_comment_url":"https://api.github.com/repos/Katello/katello-packaging/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Katello/katello-packaging/issues/145/comments","statuses_url":"https://api.github.com/repos/Katello/katello-packaging/statuses/f4c565d8792ed7640c11034ed72cf03d763c4a3e","head":{"label":"cfouant:skip-pulp","ref":"skip-pulp","sha":"f4c565d8792ed7640c11034ed72cf03d763c4a3e","user":{"login":"cfouant","id":5577256,"avatar_url":"https://avatars.githubusercontent.com/u/5577256?v=3","gravatar_id":"","url":"https://api.github.com/users/cfouant","html_url":"https://github.com/cfouant","followers_url":"https://api.github.com/users/cfouant/followers","following_url":"https://api.github.com/users/cfouant/following{/other_user}","gists_url":"https://api.github.com/users/cfouant/gists{/gist_id}","starred_url":"https://api.github.com/users/cfouant/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cfouant/subscriptions","organizations_url":"https://api.github.com/users/cfouant/orgs","repos_url":"https://api.github.com/users/cfouant/repos","events_url":"https://api.github.com/users/cfouant/events{/privacy}","received_events_url":"https://api.github.com/users/cfouant/received_events","type":"User","site_admin":false},"repo":{"id":39970825,"name":"katello-packaging","full_name":"cfouant/katello-packaging","owner":{"login":"cfouant","id":5577256,"avatar_url":"https://avatars.githubusercontent.com/u/5577256?v=3","gravatar_id":"","url":"https://api.github.com/users/cfouant","html_url":"https://github.com/cfouant","followers_url":"https://api.github.com/users/cfouant/followers","following_url":"https://api.github.com/users/cfouant/following{/other_user}","gists_url":"https://api.github.com/users/cfouant/gists{/gist_id}","starred_url":"https://api.github.com/users/cfouant/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cfouant/subscriptions","organizations_url":"https://api.github.com/users/cfouant/orgs","repos_url":"https://api.github.com/users/cfouant/repos","events_url":"https://api.github.com/users/cfouant/events{/privacy}","received_events_url":"https://api.github.com/users/cfouant/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/cfouant/katello-packaging","description":"Packaging for Katello","fork":true,"url":"https://api.github.com/repos/cfouant/katello-packaging","forks_url":"https://api.github.com/repos/cfouant/katello-packaging/forks","keys_url":"https://api.github.com/repos/cfouant/katello-packaging/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cfouant/katello-packaging/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cfouant/katello-packaging/teams","hooks_url":"https://api.github.com/repos/cfouant/katello-packaging/hooks","issue_events_url":"https://api.github.com/repos/cfouant/katello-packaging/issues/events{/number}","events_url":"https://api.github.com/repos/cfouant/katello-packaging/events","assignees_url":"https://api.github.com/repos/cfouant/katello-packaging/assignees{/user}","branches_url":"https://api.github.com/repos/cfouant/katello-packaging/branches{/branch}","tags_url":"https://api.github.com/repos/cfouant/katello-packaging/tags","blobs_url":"https://api.github.com/repos/cfouant/katello-packaging/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cfouant/katello-packaging/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cfouant/katello-packaging/git/refs{/sha}","trees_url":"https://api.github.com/repos/cfouant/katello-packaging/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cfouant/katello-packaging/statuses/{sha}","languages_url":"https://api.github.com/repos/cfouant/katello-packaging/languages","stargazers_url":"https://api.github.com/repos/cfouant/katello-packaging/stargazers","contributors_url":"https://api.github.com/repos/cfouant/katello-packaging/contributors","subscribers_url":"https://api.github.com/repos/cfouant/katello-packaging/subscribers","subscription_url":"https://api.github.com/repos/cfouant/katello-packaging/subscription","commits_url":"https://api.github.com/repos/cfouant/katello-packaging/commits{/sha}","git_commits_url":"https://api.github.com/repos/cfouant/katello-packaging/git/commits{/sha}","comments_url":"https://api.github.com/repos/cfouant/katello-packaging/comments{/number}","issue_comment_url":"https://api.github.com/repos/cfouant/katello-packaging/issues/comments{/number}","contents_url":"https://api.github.com/repos/cfouant/katello-packaging/contents/{+path}","compare_url":"https://api.github.com/repos/cfouant/katello-packaging/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cfouant/katello-packaging/merges","archive_url":"https://api.github.com/repos/cfouant/katello-packaging/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cfouant/katello-packaging/downloads","issues_url":"https://api.github.com/repos/cfouant/katello-packaging/issues{/number}","pulls_url":"https://api.github.com/repos/cfouant/katello-packaging/pulls{/number}","milestones_url":"https://api.github.com/repos/cfouant/katello-packaging/milestones{/number}","notifications_url":"https://api.github.com/repos/cfouant/katello-packaging/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cfouant/katello-packaging/labels{/name}","releases_url":"https://api.github.com/repos/cfouant/katello-packaging/releases{/id}","created_at":"2015-07-30T20:26:00Z","updated_at":"2015-07-30T20:26:00Z","pushed_at":"2016-01-20T21:22:50Z","git_url":"git://github.com/cfouant/katello-packaging.git","ssh_url":"git@github.com:cfouant/katello-packaging.git","clone_url":"https://github.com/cfouant/katello-packaging.git","svn_url":"https://github.com/cfouant/katello-packaging","homepage":null,"size":300,"stargazers_count":0,"watchers_count":0,"language":"Shell","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Katello:master","ref":"master","sha":"9ae896d8a8d6d4f17a051e16a1324fe7814d3c33","user":{"login":"Katello","id":1316386,"avatar_url":"https://avatars.githubusercontent.com/u/1316386?v=3","gravatar_id":"","url":"https://api.github.com/users/Katello","html_url":"https://github.com/Katello","followers_url":"https://api.github.com/users/Katello/followers","following_url":"https://api.github.com/users/Katello/following{/other_user}","gists_url":"https://api.github.com/users/Katello/gists{/gist_id}","starred_url":"https://api.github.com/users/Katello/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Katello/subscriptions","organizations_url":"https://api.github.com/users/Katello/orgs","repos_url":"https://api.github.com/users/Katello/repos","events_url":"https://api.github.com/users/Katello/events{/privacy}","received_events_url":"https://api.github.com/users/Katello/received_events","type":"Organization","site_admin":false},"repo":{"id":35441481,"name":"katello-packaging","full_name":"Katello/katello-packaging","owner":{"login":"Katello","id":1316386,"avatar_url":"https://avatars.githubusercontent.com/u/1316386?v=3","gravatar_id":"","url":"https://api.github.com/users/Katello","html_url":"https://github.com/Katello","followers_url":"https://api.github.com/users/Katello/followers","following_url":"https://api.github.com/users/Katello/following{/other_user}","gists_url":"https://api.github.com/users/Katello/gists{/gist_id}","starred_url":"https://api.github.com/users/Katello/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Katello/subscriptions","organizations_url":"https://api.github.com/users/Katello/orgs","repos_url":"https://api.github.com/users/Katello/repos","events_url":"https://api.github.com/users/Katello/events{/privacy}","received_events_url":"https://api.github.com/users/Katello/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Katello/katello-packaging","description":"Packaging for Katello","fork":false,"url":"https://api.github.com/repos/Katello/katello-packaging","forks_url":"https://api.github.com/repos/Katello/katello-packaging/forks","keys_url":"https://api.github.com/repos/Katello/katello-packaging/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Katello/katello-packaging/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Katello/katello-packaging/teams","hooks_url":"https://api.github.com/repos/Katello/katello-packaging/hooks","issue_events_url":"https://api.github.com/repos/Katello/katello-packaging/issues/events{/number}","events_url":"https://api.github.com/repos/Katello/katello-packaging/events","assignees_url":"https://api.github.com/repos/Katello/katello-packaging/assignees{/user}","branches_url":"https://api.github.com/repos/Katello/katello-packaging/branches{/branch}","tags_url":"https://api.github.com/repos/Katello/katello-packaging/tags","blobs_url":"https://api.github.com/repos/Katello/katello-packaging/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Katello/katello-packaging/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Katello/katello-packaging/git/refs{/sha}","trees_url":"https://api.github.com/repos/Katello/katello-packaging/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Katello/katello-packaging/statuses/{sha}","languages_url":"https://api.github.com/repos/Katello/katello-packaging/languages","stargazers_url":"https://api.github.com/repos/Katello/katello-packaging/stargazers","contributors_url":"https://api.github.com/repos/Katello/katello-packaging/contributors","subscribers_url":"https://api.github.com/repos/Katello/katello-packaging/subscribers","subscription_url":"https://api.github.com/repos/Katello/katello-packaging/subscription","commits_url":"https://api.github.com/repos/Katello/katello-packaging/commits{/sha}","git_commits_url":"https://api.github.com/repos/Katello/katello-packaging/git/commits{/sha}","comments_url":"https://api.github.com/repos/Katello/katello-packaging/comments{/number}","issue_comment_url":"https://api.github.com/repos/Katello/katello-packaging/issues/comments{/number}","contents_url":"https://api.github.com/repos/Katello/katello-packaging/contents/{+path}","compare_url":"https://api.github.com/repos/Katello/katello-packaging/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Katello/katello-packaging/merges","archive_url":"https://api.github.com/repos/Katello/katello-packaging/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Katello/katello-packaging/downloads","issues_url":"https://api.github.com/repos/Katello/katello-packaging/issues{/number}","pulls_url":"https://api.github.com/repos/Katello/katello-packaging/pulls{/number}","milestones_url":"https://api.github.com/repos/Katello/katello-packaging/milestones{/number}","notifications_url":"https://api.github.com/repos/Katello/katello-packaging/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Katello/katello-packaging/labels{/name}","releases_url":"https://api.github.com/repos/Katello/katello-packaging/releases{/id}","created_at":"2015-05-11T18:17:21Z","updated_at":"2015-07-29T18:38:28Z","pushed_at":"2016-01-20T21:23:37Z","git_url":"git://github.com/Katello/katello-packaging.git","ssh_url":"git@github.com:Katello/katello-packaging.git","clone_url":"https://github.com/Katello/katello-packaging.git","svn_url":"https://github.com/Katello/katello-packaging","homepage":null,"size":394,"stargazers_count":0,"watchers_count":0,"language":"Shell","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":17,"mirror_url":null,"open_issues_count":4,"forks":17,"open_issues":4,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Katello/katello-packaging/pulls/145"},"html":{"href":"https://github.com/Katello/katello-packaging/pull/145"},"issue":{"href":"https://api.github.com/repos/Katello/katello-packaging/issues/145"},"comments":{"href":"https://api.github.com/repos/Katello/katello-packaging/issues/145/comments"},"review_comments":{"href":"https://api.github.com/repos/Katello/katello-packaging/pulls/145/comments"},"review_comment":{"href":"https://api.github.com/repos/Katello/katello-packaging/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Katello/katello-packaging/pulls/145/commits"},"statuses":{"href":"https://api.github.com/repos/Katello/katello-packaging/statuses/f4c565d8792ed7640c11034ed72cf03d763c4a3e"}}}}