# task-scheduler

> Task Scheduler Server

Latest version **0.0.1** (published 2014-08-03) · MIT license · 0 weekly downloads

## Install

```sh
npm install task-scheduler
pnpm add task-scheduler
yarn add task-scheduler
bun add task-scheduler
```

Provides the command `tasksched`.

## Health

**Score 5/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: insecure dependencies; abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.1 |
| Published | 2014-08-03 |
| First published | 2014-05-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 14 |
| Known vulnerabilities | 0 (+7 in 4 direct dependencies) |
| Install scripts | no |
| GitHub stars | 7 |
| Author | Alex Kit |
| Maintainers | tenbits |

## Links

- npm: https://www.npmjs.com/package/task-scheduler
- Repository: https://github.com/atmajs/task-scheduler
- Issues: https://github.com/atmajs/task-scheduler/issues
- npm.io page: https://npm.io/package/task-scheduler

## Dependencies (14)

- [appcfg](https://npm.io/package/appcfg.md) ~0.1.28
- [atma-io](https://npm.io/package/atma-io.md) ~0.1.76
- [mongodb](https://npm.io/package/mongodb.md) ~1.4.4
- [request](https://npm.io/package/request.md) ~2.36.0
- [atma-libs](https://npm.io/package/atma-libs.md) ~0.9.35
- [socket.io](https://npm.io/package/socket.io.md) ~1.0.3
- [atma-logger](https://npm.io/package/atma-logger.md) ~0.0.88
- [atma-server](https://npm.io/package/atma-server.md) 0.0.97
- [body-parser](https://npm.io/package/body-parser.md) ~1.4.3
- [forever-monitor](https://npm.io/package/forever-monitor.md) git+https://github.com/tenbits/forever-monitor.git#9eb5efc8bd79cd7cf2ace8cd96f94f7eab34754e
- [atma-loader-less](https://npm.io/package/atma-loader-less.md) >0.0.0
- [socket.io-client](https://npm.io/package/socket.io-client.md) ~1.0.6
- [atma-loader-package](https://npm.io/package/atma-loader-package.md) >0.0.0
- [atma-loader-traceur](https://npm.io/package/atma-loader-traceur.md) >0.0.0

## Recent versions

- 0.0.1 (latest) — 2014-08-03
- 0.0.0 — 2014-05-15

## README

Task Scheduler
----
[![Build Status](https://travis-ci.org/atmajs/task-scheduler.svg?branch=master)](https://travis-ci.org/atmajs/task-scheduler)

**_Work in progress_**


Task Scheduler Server to schedule or run scripts/applications/commands which:
- scales. Server consists of a master task queue process and the workers. 
- has web interface
- has RESTful API
- has websockets
- has database persistance


#### Time Triggers
Describe with:
- [RRule](https://github.com/jakubroztocil/rrule)
- [Cron](https://github.com/tenbits/cron-parser)
- One time triggers:
	- `Date` instance
	- relative to the current time, like `in 2 hours and 20 minutes`
	
#### Executors
- source: `{ src: 'tasks/foo.js' }`
- command: `{ command: 'wget -i file' }`
- request: `{ url: 'http://foo.com/baz', method: 'POST', data: {}}`

### CLI
```bash
$ npm i -g task-scheduler
$ tasksched --help

# Server
$ tasksched server --help
# - start the server
$ tasksched server start
# - stop the server
$ tasksched server stop

# Application
$ tasksched app --help
# - create the application. Tasks are bound to the app after the authorization
$ tasksched app create --name Foo --password BazPass
# ... for more infos, see the help action

# Task
$ tasksched task --help
# - create the task
$ tasksched task create --name FooName --trigger "in 20 minutes" --exec.src baz.js
# ... for more infos, see the help action
```

### Web Interface
Start the server `$ tasksched server start` and navigate to `http://localhost:5888/`

### Client module
```javascript
	var client = require('task-scheduler-client');
	client
		.ensureTask({
			name: 'sync data',
			trigger: 'FREQ=DAILY;BYHOUR=23',
			exec: {
				src: '/tasks/sync-data.js'
			}
		})
		.done(onSuccess) //> created
		.fail(onError)   //> task creation failed
		;
```
> If the task with the same name, same `trigger` and `exec` already exists, it will do nothing.

----
(c) MIT - The Atma.js Project

---
_Source: https://npm.io/package/task-scheduler · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
