Skip to content

Instantly share code, notes, and snippets.

@jbodah
Created June 4, 2015 16:49
Show Gist options
  • Save jbodah/2ef4387a0a7f9226aa40 to your computer and use it in GitHub Desktop.
Save jbodah/2ef4387a0a7f9226aa40 to your computer and use it in GitHub Desktop.
yard cron
# cron
* * * * * ~/yard/restart_server > ~/yard/restart_server.log 2>&1
# restart_servers
#! /usr/bin/env bash
echo 'Killing yard server...'
ps aux | grep 'yard server' | grep -v 'grep' | awk '{ print $2 }' | xargs kill
echo 'Pulling new code...'
cd /home/vagrant/yard && git pull
echo 'Starting yard server...'
export PATH=/home/vagrant/.rbenv/shims:/home/vagrant/.rbenv/bin:/usr/bin:$PATH;
eval "$(rbenv init -)"
yard server -d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment