{"_id":"54fda39021538c21006c49ad","githubsync":"","project":"545e249c7ca5470800b3a1b2","category":{"_id":"54fda38f21538c21006c49a8","version":"54fda38e21538c21006c49a6","__v":2,"pages":["54fda39021538c21006c49ac","54fda39021538c21006c49ad","54fda39021538c21006c49ae","54fda39021538c21006c49af","554cb5c01f5dd20d008a7bdd"],"project":"545e249c7ca5470800b3a1b2","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2014-11-08T16:56:01.271Z","from_sync":false,"order":1,"slug":"commands","title":"Commands"},"user":"545e246f7ca5470800b3a1b1","version":{"_id":"54fda38e21538c21006c49a6","__v":3,"forked_from":"54eb4535615ffc19003059f0","project":"545e249c7ca5470800b3a1b2","createdAt":"2015-03-09T13:43:42.927Z","releaseDate":"2015-03-09T13:43:42.927Z","categories":["54fda38f21538c21006c49a7","54fda38f21538c21006c49a8","54fda38f21538c21006c49a9","54fda38f21538c21006c49aa","54fda38f21538c21006c49ab","54fda3d347f93619001d2ae2","54fea8975c4ab10d00ef4279"],"is_deprecated":false,"is_hidden":false,"is_beta":true,"is_stable":true,"codename":"","version_clean":"0.5.0","version":"0.5.0"},"__v":0,"metadata":{"title":"","description":"","image":[]},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2014-11-08T17:14:41.393Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"auth":"never","params":[],"url":""},"isReference":false,"order":0,"body":"[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"tar_gz\"\n}\n[/block]\nCollect files to a `tar` archive and compress the archive using `gzip`.\n\n## Typical usage\n\n### Compress a file\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"host \\\"app-host\\\", hostname: \\\"www.example.com\\\"\\n\\njob \\\"config-backup\\\" do\\n  resource \\\"file\\\", path: \\\"/etc/config/file\\\", host: \\\"app-host\\\"\\n  remotely as: \\\"user\\\" do\\n    tar_gz\\n  end\\nend\\n\",\n      \"language\": \"ruby\",\n      \"name\": \"Sheepfile\"\n    }\n  ]\n}\n[/block]\n### Compress a directory\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"host \\\"app-host\\\", hostname: \\\"www.example.com\\\"\\n\\njob \\\"config-backup\\\" do\\n  resource \\\"directory\\\", path: \\\"/var/www/uploads\\\", host: \\\"app-host\\\"\\n  remotely as: \\\"user\\\" do\\n    tar_gz\\n  end\\nend\",\n      \"language\": \"ruby\",\n      \"name\": \"Sheepfile\"\n    }\n  ]\n}\n[/block]\n## Input resources\n\nResources of type `file` or `directory` are allowed.\n\n## Output resource\n\nA resource of type `file`.\n\n### Command options\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Option\",\n    \"h-1\": \"Description\",\n    \"0-2\": \"Required: no\\nDefaults to: `false`\",\n    \"0-0\": \"`delete_source`\",\n    \"0-1\": \"Indicate whether the source file or directory should be deleted after compression. Use with caution.\"\n  },\n  \"cols\": 3,\n  \"rows\": 1\n}\n[/block]","excerpt":"Archive files or directories using various compression algorithms","slug":"compression","type":"basic","title":"Files & Directories compression"}

Files & Directories compression

Archive files or directories using various compression algorithms

[block:api-header] { "type": "basic", "title": "tar_gz" } [/block] Collect files to a `tar` archive and compress the archive using `gzip`. ## Typical usage ### Compress a file [block:code] { "codes": [ { "code": "host \"app-host\", hostname: \"www.example.com\"\n\njob \"config-backup\" do\n resource \"file\", path: \"/etc/config/file\", host: \"app-host\"\n remotely as: \"user\" do\n tar_gz\n end\nend\n", "language": "ruby", "name": "Sheepfile" } ] } [/block] ### Compress a directory [block:code] { "codes": [ { "code": "host \"app-host\", hostname: \"www.example.com\"\n\njob \"config-backup\" do\n resource \"directory\", path: \"/var/www/uploads\", host: \"app-host\"\n remotely as: \"user\" do\n tar_gz\n end\nend", "language": "ruby", "name": "Sheepfile" } ] } [/block] ## Input resources Resources of type `file` or `directory` are allowed. ## Output resource A resource of type `file`. ### Command options [block:parameters] { "data": { "h-0": "Option", "h-1": "Description", "0-2": "Required: no\nDefaults to: `false`", "0-0": "`delete_source`", "0-1": "Indicate whether the source file or directory should be deleted after compression. Use with caution." }, "cols": 3, "rows": 1 } [/block]