That damn Nexus [N] is out of stock in UK. Get a mail a minute later is back to stock. Need cron and UK based hosting.
- Update your credentials and preferences in
bundle exec bin/nexus-ping
Create a new file under
user_pref.yml. You can start from
config/user_pref.yml.example or copy paste these lines and update values with your preferences.
# pretty self-explanatory EMAIL_TO_NOTIFY: "your_email" # Gmail credential used to send the mail GMAIL_USER: "gmail_username" GMAIL_PASSWORD: "gmail_password" # Devices to observe, a mail will be sent for each one marked with "observed" NEXUS_4_8G: "not observed" NEXUS_4_16G: "observed" NEXUS_7_16G: "observed" NEXUS_7_32G: "not observed" NEXUS_7_32G_3G: "not observed" NEXUS_10_16G: "not observed" NEXUS_10_32G: "observed"
Gmail account is used as SMTP server to send notification mails.
This is a sample cronjob to schedule the script via crontab.
*/30 7-21 * * * PATH=$PATH:/usr/local/rbenv/shims && cd /path/to/nexus-ping/current && bundle exec bin/nexus-ping
Nexus-ping is launched every 30 minutes between 7am and 9pm, first instruction loads rbenv shims in
$PATH, since cronjobs don't run on interactive shells.
Change shims path according to your rbenv install.
Put the cronjob in a file named
config/ and you'll be able to manage script start/stop with Capistrano.
Three custom Capistrano tasks are included:
cron:set: sets user crontab reading from server
config/croncronjob file, this is intended to start the scheduled polling
cron:remove: WARNING! removes all cronjob from user crontab, which stops script polling
You'll need to update
config/deploy.rb with your server details (IP, deploy_path, rbenv conf)