Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrie30 committed Sep 28, 2024
1 parent d1bb7c3 commit 3f1a23b
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -268,23 +268,21 @@ curl https://raw.githubusercontent.com/gabrie30/ghorg/master/sample-reclone.yaml

Update file with the commands you wish to run.

## Reclone Server and Cron Commands

### Reclone Server
## Reclone Server Command

The `reclone-server` command starts a server that allows you to trigger adhoc reclone commands via HTTP requests.

#### Usage
### Usage

```sh
ghorg reclone-server [flags]
```

#### Flags
### Flags

- `--port`: Specify the port on which the server will run. If not specified, the server will use the default port.

#### Endpoints
### Endpoints

- **`/trigger/reclone`**: Triggers the reclone command. To prevent resource exhaustion, only one request can processed at a time.
- **Query Parameters**:
Expand All @@ -303,7 +301,7 @@ ghorg reclone-server [flags]
- **Responses**:
- `200 OK`: Server is healthy.

#### Examples
### Examples

Starting the server. The default port is `8080` but you can optionally start the server on different port using the `--port` flag:

Expand Down Expand Up @@ -335,29 +333,29 @@ Check the server health:
curl "http://localhost:8080/health"
```

### Reclone Cron
## Reclone Cron Command

The `reclone-cron` command sets up a simple cron job that triggers the reclone command at specified minute intervals indefinitely.

#### Usage
### Usage

```sh
ghorg reclone-cron [flags]
```

#### Flags
### Flags

- `--minutes`: Specify the interval in minutes at which the reclone command will be triggered. Default is every 60 minutes.

#### Example
### Example

Set up a cron job to trigger the reclone command every day:

```sh
ghorg reclone-cron --minutes 1440
```

#### Environment Variables
### Environment Variables

- `GHORG_CRON_TIMER_MINUTES`: The interval in minutes for the cron job. This can be set via the `--minutes` flag. Defualt is 60 minutes.

Expand Down

0 comments on commit 3f1a23b

Please sign in to comment.