github.com/smintz/nomad@v0.8.3/website/source/docs/commands/job/history.html.md.erb (about) 1 --- 2 layout: "docs" 3 page_title: "Commands: job history" 4 sidebar_current: "docs-commands-job-history" 5 description: > 6 The history command is used to display all tracked versions of a job. 7 --- 8 9 # Command: job history 10 11 The `job history` command is used to display the known versions of a particular 12 job. The command can display the diff between job versions and can be useful for 13 understanding the changes that occurred to the job as well as deciding job 14 versions to revert to. 15 16 ## Usage 17 18 ``` 19 nomad job history [options] <job> 20 ``` 21 22 The `job history` command requires a single argument, the job ID or an ID prefix 23 of a job to display the history for. 24 25 ## General Options 26 27 <%= partial "docs/commands/_general_options" %> 28 29 ## History Options 30 31 * `-p`: Display the differences between each job and its predecessor. 32 33 * `-full`: Display the full job definition for each version. 34 35 * `-version`: Display only the history for the given version. 36 37 * `-json` : Output the job versions in its JSON format. 38 39 * `-t` : Format and display the job versions using a Go template. 40 41 ## Examples 42 43 Display the history showing differences between versions: 44 45 ``` 46 $ nomad job history -p e 47 Version = 2 48 Stable = false 49 Submit Date = 07/25/17 20:35:43 UTC 50 Diff = 51 +/- Job: "example" 52 +/- Task Group: "cache" 53 +/- Task: "redis" 54 +/- Resources { 55 CPU: "500" 56 DiskMB: "0" 57 IOPS: "0" 58 +/- MemoryMB: "256" => "512" 59 } 60 61 Version = 1 62 Stable = false 63 Submit Date = 07/25/17 20:35:31 UTC 64 Diff = 65 +/- Job: "example" 66 +/- Task Group: "cache" 67 +/- Count: "1" => "3" 68 Task: "redis" 69 70 Version = 0 71 Stable = false 72 Submit Date = 07/25/17 20:35:28 UTC 73 ``` 74 75 Display the memory ask across submitted job versions: 76 77 ``` 78 $ nomad job history -t "{{range .}}\ 79 v{{.Version}}: {{with index .TaskGroups 0}}{{with index .Tasks 0}}{{.Resources.MemoryMB}}{{end}}{{end}}\ 80 81 {{end}}" example 82 v2: 512 83 v1: 256 84 v0: 256 85 ```