{"action":"opened","issue":{"url":"https://api.github.com/repos/nickfan/envoy-deployscript/issues/1","labels_url":"https://api.github.com/repos/nickfan/envoy-deployscript/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/nickfan/envoy-deployscript/issues/1/comments","events_url":"https://api.github.com/repos/nickfan/envoy-deployscript/issues/1/events","html_url":"https://github.com/nickfan/envoy-deployscript/issues/1","id":99701867,"number":1,"title":"Issue with cleanup_oldreleases","user":{"login":"robertvrabel","id":634788,"avatar_url":"https://avatars.githubusercontent.com/u/634788?v=3","gravatar_id":"","url":"https://api.github.com/users/robertvrabel","html_url":"https://github.com/robertvrabel","followers_url":"https://api.github.com/users/robertvrabel/followers","following_url":"https://api.github.com/users/robertvrabel/following{/other_user}","gists_url":"https://api.github.com/users/robertvrabel/gists{/gist_id}","starred_url":"https://api.github.com/users/robertvrabel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robertvrabel/subscriptions","organizations_url":"https://api.github.com/users/robertvrabel/orgs","repos_url":"https://api.github.com/users/robertvrabel/repos","events_url":"https://api.github.com/users/robertvrabel/events{/privacy}","received_events_url":"https://api.github.com/users/robertvrabel/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-08-07T18:19:45Z","updated_at":"2015-08-07T18:19:45Z","closed_at":null,"body":"This line: https://github.com/nickfan/envoy-deployscript/blob/master/Envoy.blade.php#L511\r\n\r\n```\r\nls -dt {{ $release_dir }}/* | tail -n +4 | xargs -d '\\n' rm -rf;\r\n```\r\n\r\nFor my case that command basically started traversing through my whole server trying to delete everything. Tried to debug it the best I could but couldn't pin point it exactly. Its like the last command doesn't return the paths properly. I'd be happy to debug more if anyone has suggestions.\r\nServer info is: Red Hat Enterprise Linux Server release 6.6 (Santiago) \r\n\r\nThis command worked for my case as a replacement:\r\n```\r\n(ls -rd {{ $release_dir }}/*|head -n 4;ls -d {{ $release_dir }}/*)|sort|uniq -u|xargs rm -rf\r\n```"}}