Create entry in /etc/cron.d

def cron(name, timespec, user, command, environ=None, disable=False):
    """Create entry in /etc/cron.d"""
    path = '/etc/cron.d/{}'.format(name)
    if disable:
        sudo('rm ' + path)
        return
    entry = '{}\t{}\t{}\n'.format(timespec, user, command)
    if environ:
        envstr = '\n'.join('{}={}'.format(k, v)
                           for k, v in environ.iteritems())
        entry = '{}\n{}'.format(envstr, entry)
    chput(StringIO(entry), path, use_sudo=True,
          mode=0o644, user='root', group='root')