OAS: Cheat Sheet: File / Directories
OAS: Cheat Sheet: File / Directories
OAS: Cheat Sheet: File / Directories
File / Directories
Configuration
# Standard configuration
/opt/guardvant/db
/opt/guardvant/configs
# Client configuration
/opt/guardvant/clients/<minesite>/db
# Local configuration
/opt/guardvant/db/gvos.conf
# Profile Configuration
Attached to operator/location profile, example:
/opt/guardvant/db/oper-eye.json
Logs
# logs directory
/opt/guardvant/logs
GVOS Commands
objects all
web
replicator
-- on equipment
face_yaw_scaler
face_tensor
fatigue
gps
audio
eyes
fatigue.seat_enabled
gps.fake_speed
Set component properties (when gvos restarted, it will back to original value)
-- on server
web.query_limit=100000
-- equipment
gps.fake_speed=30
eyes.tracking_sensitivity=0.8
eyes.closure_sensitivity=0.8
face_tensor.microsleep_percent=25
face_tensor.microsleep_percent_high=25
-- server
web methods
manager methods
replicator devices
mail_notifier get_mail_lists
-- equipment
GvSensor sensors
GvDevice.this_device.properties
GvDevice.this_device.all_groups
mv /tmp/gvxxx ~/T52006.db
sqlite3 /-csv ~/T52006.db
-- server
listen replicator
listen mail_notifier
-- equipment
listen sensor_face_yaw
listen face_tensor
list sensor_gps
listen sensor_adc_illum
listen fatigue
list sensor_gps_speed
unlisten replicator
unlisten mail_notifier
unlisten face_tensor
# Adding timestamp
-
self.timestamps=true
example:
fatigue event microsleep now 4000 50
Misc Commands
# delete it
find snapshots/*/ \( -type f -a -mtime +180 \) -print 'removing file %p \n' -delete
File location
df
/data/dvr/<equipment_name>
/backup/dvr/<equipment_name>
gv_admin
/opt/guardvant/scripts/gv_admin
clean --> listed suggestion of configuration that no longer used anymore / might not be needed
diff --> giving difference between json file (/opt/guardvant/clients/<minesite>/db) and database
--> It will dump client configuration into different json files (grouped by device) under /opt/guardvant/clients
/<minesite>/db
cd /opt/guardvant/clients/<minesite>/db
gv_model load -v -D postgres://localhost/cananea,user=gv_admin,password=guard4640 server.json
curl http://localhost/gvos/manager/download_software,config,null,null
curl http://localhost/gvos/manager/download_software,config,null,null > netconfig.json
Database Commands
guardvant@HT02:~$ cd /data/db/
guardvant@HT02:/data/db$ /etc/init.d/gvos stop
stopping /etc/init.d/gvos
guardvant@HT02:/data/db$ rm opguard.*
guardvant@HT02:/data/db$ cp ~/opguard.db .
guardvant@HT02:/data/db$ /etc/init.d/gvos start
# Using “gv_sql”
server=# gv_sql load -d my_dump -o postgres://localhost/my_database,user=guardvant,password=guard4640
Backup/Restore Table
# Using “pg_dump” to dump the table
server=# pg_dump -t configurations my_database2 > configurations.sql
SET
SET
CREATE TABLE
ALTER TABLE
CREATE SEQUENCE
ALTER TABLE
COPY 1183
setval
--------
1221
(1 row)
ALTER TABLE
server=#
# Using “gv_sql dump –h” to dump database with historical data up to X number of hours
Replicate Database
sudo /opt/guardvant/scripts/gvbackup install -n <name of the process/script that will be appear on etc init d>
<source_database> <destination_database>
Example:
postgres to postgres
-
sudo /opt/guardvant/scripts/gvbackup install -n mymine_backup postgres://localhost/mymine,user=gv_admin,
password=guard4640 postgres://localhost/mymine_backup,user=gv_admin,password=guard4640
postgres to sqlserver
-
sudo /opt/guardvant/scripts/gvbackup install -n mymine_backup postgres://localhost/mymine,user=gv_admin,
password=guard4640 freetds://sqlserverhost/mymine,user=myuser,password=mypassword
$ cat /etc/owrt-arch
OWRT_arch=gvpc-imx6
OWRT_version=6.1-8
OWRT_major=6
OWRT_topology=fixed
$ cat /etc/os-release
NAME="OpenWrt"
VERSION="6.1"
ID="openwrt"
ID_LIKE="lede openwrt"
PRETTY_NAME="OpenWrt 6.1"
VERSION_ID="6.1"
HOME_URL="http://opkg.guardvant.com"
BUG_URL="http://bugs.openwrt.org/"
SUPPORT_URL="http://forum.lede-project.org/"
BUILD_ID="r9334-43af42a9f9"
LEDE_BOARD="imx6/generic-glibc"
LEDE_ARCH="armv7_neon"
LEDE_TAINTS="no-all glibc busybox"
LEDE_DEVICE_MANUFACTURER="Hexagon"
LEDE_DEVICE_MANUFACTURER_URL="http://openwrt.org/"
LEDE_DEVICE_PRODUCT="OpGuard"
LEDE_DEVICE_REVISION="v0"
LEDE_RELEASE="OpenWrt 6.1 r9334-43af42a9f9"
Related articles
OAS: GVOS Configuration Reference
OP Pro: Identify old shift records that has been updated recently
OAS: Post Installation Configuration
OAS: OpWeb Configuration Reference
OP Pro: Improving security on Linux Server