Skip to content

Instantly share code, notes, and snippets.

View arbovm's full-sized avatar

Arbo von Monkiewitsch arbovm

View GitHub Profile
@arbovm
arbovm / next_chef_run_on.sh
Created November 20, 2012 13:04
query next chef run on a given server
#!/bin/bash
ssh $1 <<EOF
ps_line=\$(ps aux | grep chef-client | grep sleep )
secs=\$(echo \$ps_line | grep -o 'sleep [0-9]*' | cut -d' ' -f2)
start=\$(echo \$ps_line | awk '{print \$9}')
start_min=\$(echo \$start | cut -d':' -f 1)
start_sec=\$(echo \$start | cut -d':' -f 2)