Skip to content

Instantly share code, notes, and snippets.

@itsderek23
Forked from andre/scout_cron.sh
Created February 18, 2013 18:14
Show Gist options
  • Select an option

  • Save itsderek23/4979374 to your computer and use it in GitHub Desktop.

Select an option

Save itsderek23/4979374 to your computer and use it in GitHub Desktop.

Revisions

  1. @andre andre created this gist Jan 23, 2013.
    19 changes: 19 additions & 0 deletions scout_cron.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,19 @@
    #! /usr/bin/env bash

    # This example bash script file is located here: /home/your-username/scripts/scout_cron.sh for our example, but could be anywhere on your server.
    # Make sure you remember to make this file an executable script by: chmod +x /home/your-username/scripts/scout_cron.sh.

    # Loading the RVM Environment files. To find your unique rvm path use: rvm env --path -- ruby-version[@gemset-name].
    # For example: rvm env --path -- 1.9.3-p194@projectX
    source /home/deploy/.rvm/environments/ruby-1.9.3-p374

    # Changing directories to our rails project. The example below is a Capistrano path.
    cd /u/apps/zed/current

    # Call Scout and pass your unique key you were given.
    bundle exec scout KEY

    # Below is an example of using this script from cron every minute.
    # Type crontab -e to edit your user's cron file and add the following two lines at the bottom.
    # MAILTO=""
    # * * * * * /home/your-username/scripts/scout_cron.sh