code: def cron(name, timespec, user, command, environ=None, disable=False):
      
      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')
docs: Create entry in /etc/cron.d