hypnos

package module
v0.0.0-...-d61d337 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 8, 2017 License: MIT Imports: 2 Imported by: 0

README

hypnos

A sleepy cron

Ever write little scripts like to do things on some interval?

#!/bin/bash
while [ 1 ]; do
  echo "running some tasks..."
  # ...
  sleep 3600
done

Want it to be more like cron? And start repeatedly at specific times?

#!/bin/bash
while [ 1 ]; do
  hypnos "0 * * * *"
  echo "running some tasks..."
  # ...
done
Next run at 2017-01-31 19:00:00 -0800 PST Sleeping for 33m25.234920265s

Installation

Grab a tarball from Releases and install in your path.

Or build from source

go get github.com/transitorykris/hypnos

Examples

Hypnos follows cron

Run once per minute

hypnos "* * * * *"

Run once per week

hypnos @weekly

Run on Fridays at 5:30pm

hypnos "30 17 * * FRI"

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Sleep

func Sleep(interval string) (time.Duration, time.Time, error)

Sleep returns the length of time to wait until the next interval expressed in crontab notation along with the date for when that will happen. If the crontab expression fails to parse an error will be returned.

Types

This section is empty.

Directories

Path Synopsis
cmd
hypnos command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL