Skip to content

Commit

Permalink
Add instructions to install as cron job
Browse files Browse the repository at this point in the history
  • Loading branch information
Tomy2e committed Jan 29, 2022
1 parent 40990e8 commit 7c26462
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,44 @@ The tool reads the following environment variables:
| -------- | --------------------------------------------------------------------------------- | ------------- |
| LOGIN | DynHost login. The tool will exit if this environment variable is not defined. | |
| PASSWORD | DynHost password. The tool will exit if this environment variable is not defined. | |

## Installation

### cron job

Run the following commands to download the tool:

```bash
sudo wget https://github.com/Tomy2e/ovh-dynhost-updater/releases/latest/download/ovh-dynhost-updater-linux-amd64 -O /usr/local/bin/ovh-dynhost-updater
sudo chmod +x /usr/local/bin/ovh-dynhost-updater
```

Update the `CHANGEME` values then run the following commands to create the file
that contains your DynHost credentials:

```bash
sudo bash -c "cat >> /usr/local/etc/ovh-dynhost-updater-creds" << EOL
export LOGIN=CHANGEME
export PASSWORD=CHANGEME
EOL
sudo chmod 0700 /usr/local/etc/ovh-dynhost-updater-creds
```

Open the crontab file:

```bash
sudo crontab -e
```

Append the following line to your crontab file, update the `CHANGEME` values,
then save:

```bash
*/10 * * * * (. /usr/local/etc/ovh-dynhost-updater-creds && /usr/local/bin/ovh-dynhost-updater --hostname=CHANGEME) 2>&1 | logger -t ovh-dynhost-updater
```

The tool will run every ten minutes, run the following command to see the logs:

```bash
grep 'ovh-dynhost-updater' /var/log/syslog
```

0 comments on commit 7c26462

Please sign in to comment.