Browse Source

Added config file and updated README

master
Chris Mahoney 2 years ago
parent
commit
f69030610a
  1. 1
      .gitignore
  2. 30
      README.md
  3. 15
      commit.py
  4. 9
      config.json.template

1
.gitignore

@ -1,2 +1,3 @@
logs/
processed/
config.json

30
README.md

@ -1 +1,29 @@
initail commit
soups
======
**soups** is a set of scripts for running the apgmera soup search and tracking our findings.
## Usage
To install first clone the repo
```
$ git clone https://gitea.cslabs.clarkson.edu/mahonec/soups.git
```
Then fill in the config file with mysql your mysql configuration and the path of cloned directory
```
$ cp config.json.template config.json
```
(If you don't yet have a mysql database and tables read the future section)
To start the soup search execute run.sh
```
$ chmod +x run.sh
$ ./run.sh
```
Finally add a crontab to execute `commit.py` every hour
```
$ crontab -e
0 * * * * python3 /path/to/directory/commit.py
```

15
commit.py

@ -1,14 +1,17 @@
from os import listdir, system
import mysql.connector
import mysql.connector, json
with open("config.json", "r") as fp:
config = json.load(fp)
mydb = mysql.connector.connect(
host="trilogy",
user="soup",
password="ecosystem-pusher-riveter-nifty",
database="soups"
host=config["mysql"]["host"],
user=config["mysql"]["user"],
password=config["mysql"]["password"],
database=config["mysql"]["database"]
)
home = "/home/mahonec/soup/"
home = config["home"]
# Get logs
logs = [home + "logs/" + f for f in listdir(home + "logs/")]

9
config.json.template

@ -0,0 +1,9 @@
{
"mysql":{
"host":"host",
"user":"user",
"password":"password",
"database":"soups"
},
"home":"/path/to/directory/"
}
Loading…
Cancel
Save