{"action":"created","issue":{"url":"https://api.github.com/repos/opinkerfi/adagios/issues/546","repository_url":"https://api.github.com/repos/opinkerfi/adagios","labels_url":"https://api.github.com/repos/opinkerfi/adagios/issues/546/labels{/name}","comments_url":"https://api.github.com/repos/opinkerfi/adagios/issues/546/comments","events_url":"https://api.github.com/repos/opinkerfi/adagios/issues/546/events","html_url":"https://github.com/opinkerfi/adagios/issues/546","id":66213419,"number":546,"title":"Backup/restore option","user":{"login":"boardstretcher","id":2272852,"avatar_url":"https://avatars.githubusercontent.com/u/2272852?v=3","gravatar_id":"","url":"https://api.github.com/users/boardstretcher","html_url":"https://github.com/boardstretcher","followers_url":"https://api.github.com/users/boardstretcher/followers","following_url":"https://api.github.com/users/boardstretcher/following{/other_user}","gists_url":"https://api.github.com/users/boardstretcher/gists{/gist_id}","starred_url":"https://api.github.com/users/boardstretcher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/boardstretcher/subscriptions","organizations_url":"https://api.github.com/users/boardstretcher/orgs","repos_url":"https://api.github.com/users/boardstretcher/repos","events_url":"https://api.github.com/users/boardstretcher/events{/privacy}","received_events_url":"https://api.github.com/users/boardstretcher/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/opinkerfi/adagios/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-04-03T19:29:22Z","updated_at":"2016-03-18T16:47:09Z","closed_at":null,"body":"As with any serious 'production' tool, this needs to have a way to press a button and get a backup of the entire configuration. Similarly, it should be possible to restore that configuration to a new install."},"comment":{"url":"https://api.github.com/repos/opinkerfi/adagios/issues/comments/198447619","html_url":"https://github.com/opinkerfi/adagios/issues/546#issuecomment-198447619","issue_url":"https://api.github.com/repos/opinkerfi/adagios/issues/546","id":198447619,"user":{"login":"spicysomtam","id":1140932,"avatar_url":"https://avatars.githubusercontent.com/u/1140932?v=3","gravatar_id":"","url":"https://api.github.com/users/spicysomtam","html_url":"https://github.com/spicysomtam","followers_url":"https://api.github.com/users/spicysomtam/followers","following_url":"https://api.github.com/users/spicysomtam/following{/other_user}","gists_url":"https://api.github.com/users/spicysomtam/gists{/gist_id}","starred_url":"https://api.github.com/users/spicysomtam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spicysomtam/subscriptions","organizations_url":"https://api.github.com/users/spicysomtam/orgs","repos_url":"https://api.github.com/users/spicysomtam/repos","events_url":"https://api.github.com/users/spicysomtam/events{/privacy}","received_events_url":"https://api.github.com/users/spicysomtam/received_events","type":"User","site_admin":false},"created_at":"2016-03-18T16:47:09Z","updated_at":"2016-03-18T16:47:09Z","body":"This might help; this is what we do. Back it up locally and then scp it somewhere off the server. Occasionally where people have screwed up, I have restored individual host .cfg files back:\r\n\r\n    # cat /usr/local/sbin/backup-nagios-adagios.sh\r\n    #!/bin/bash\r\n\r\n    SSH=\"ssh -oStrictHostKeyChecking=no -oUserKnownHostsFile=/dev/null $1\"\r\n    SCP=\"scp -oStrictHostKeyChecking=no -oUserKnownHostsFile=/dev/null\"\r\n    BCKDIR=/var/lib/adagios-backup\r\n    AGE=15\r\n\r\n    tar -C / -cf /backup/nagios-adagios-backup-$(date '+%d%b%Y').tar etc/nagios usr/share/okconfig usr/lib64/nagios usr/local/bin usr/local/sbin\r\n\r\n    $SSH \"[ -d $BCKDIR ] || mkdir -p $BCKDIR\"\r\n    $SCP /backup/nagios-adagios-backup-$(date '+%d%b%Y').tar $1:$BCKDIR/\r\n\r\n    find /backup -name \"nagios-adagios-backup-*.tar\" -mtime +$AGE -exec rm -f {} \\;\r\n    $SSH \"find $BCKDIR -name \\\"nagios-adagios-backup-*.tar\\\" -mtime +$AGE -exec rm -f {} \\;\"\r\n"}}