Skip to main content

Cli like cron, to run task a specific time

Project description

Cronlike cli :)

logo

runat

Tiny replacement for crontab

Use Case/Note

  • Run it inside container 🥚.
  • Your crontab is broken 🐛.
  • For security compliance 🔒.
  • Anything you mayneed 🚑.

Notes

  • Crontab running on your timezone, if you want to use UTC pass arg --utc

Option

> runat --help
usage: main.py [-h] --cron CRON --do DO [--utc]

tiny replacement cron for different usages

optional arguments:
  -h, --help            show this help message and exit
  --cron CRON, -c CRON  cron like syntax "22 23 * * *"
  --do DO, -d DO        list of command or shell script
  --utc, -u             Use UTC time

Useages

runat --cron "01 23 * * *"  --do "cd /srv/;bash cleanTemp.sh | tee  -a /var/log/cleanTemp.log"

#To use UTC time
runat --cron "01 23 * * *"  --do "cd /srv/;bash cleanTemp.sh | tee  -a /var/log/cleanTemp.log" --utc
> The next run  in 1.0 hour, 54.0 minutes, 44.0 seconds

Exmaple output:

runat --cron "01 23 * * *"  --do "cd /srv/;bash cleanTemp.sh | tee  -a /var/log/cleanTemp.log"
> The next run  in 23.0 hours, 59.0 minutes, 56.0 seconds

Installation using pypi

pip install runat

Installation

$ pip install -r requirements.txt

$ pip install setup.py

Development

This project includes a number of helpers in the Makefile to streamline common development tasks.

Environment Setup

The following demonstrates setting up and working with a development environment:

### create a virtualenv for development

$ make virtualenv

$ source env/bin/activate


### run runat cli application

$ runat --help


### run pytest / coverage

$ make test

Releasing to PyPi

Before releasing to PyPi, you must configure your login credentials:

~/.pypirc:

[pypi]
username = YOUR_USERNAME
password = YOUR_PASSWORD

Then use the included helper function via the Makefile:

$ make dist

$ make dist-upload

Deployments

Docker

Note

If you want to work on local file you should mount it to the container using -v

Included is a basic Dockerfile for building and distributing Redis Mirror , and can be built with the included make helper:

$ make docker

$ docker run -it runat --help

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

runat-0.1.0.tar.gz (16.0 kB view hashes)

Uploaded Source

Built Distribution

runat-0.1.0-py3-none-any.whl (16.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page