remove sqlite in bash and set proper local tmp file

master
Sascha 2022-08-04 20:19:56 +07:00
parent ae8fe8203b
commit 0eb9415f24
4 changed files with 14 additions and 11 deletions

Binary file not shown.

@ -1,19 +1,19 @@
#!/bin/bash
function writeSqlite3 ()
{
# now import the csv data in to sqlite db
echo "write data to sqlite3"
sqlite3 -batch bandwidth.db <<"EOF"
.separator ","
.import speedtest.tmp bandwidth
EOF
}
# function writeSqlite3 ()
# {
# # now import the csv data in to sqlite db
# echo "write data to sqlite3"
# sqlite3 -batch bandwidth.db <<"EOF"
# .separator ","
# .import speedtest.tmp bandwidth
# EOF
# }
function writeMariaDB ()
{
echo "write data to mariadb"
mariadb-import --host server0 --user root -plungretter1 --local --fields-terminated-by=',' bandwidth /home/sascha/speedtest.tmp
mariadb-import --host server0 --user root -plungretter1 --local --fields-terminated-by=',' bandwidth speedtest.tmp
}
function runTest ()
@ -24,7 +24,7 @@ function runTest ()
bat speedtest.tmp
# write output to db
writeSqlite3
# writeSqlite3
writeMariaDB
# write output to csv

@ -0,0 +1,2 @@
35692,Clouvider Ltd,Frankfurt Am Main,2022-08-04T18:17:40.548119Z,221.19864243205473,23.564,246840561.14484474,20721710.579230364,,5.146.68.185
29320,WiTCOM,Wiesbaden,2022-08-04T18:18:39.392004Z,205.6488933950454,24.203,253694035.70635754,23220505.965713702,,5.146.68.185
1 35692 Clouvider Ltd Frankfurt Am Main 2022-08-04T18:17:40.548119Z 221.19864243205473 23.564 246840561.14484474 20721710.579230364 5.146.68.185
2 29320 WiTCOM Wiesbaden 2022-08-04T18:18:39.392004Z 205.6488933950454 24.203 253694035.70635754 23220505.965713702 5.146.68.185

@ -0,0 +1 @@
29320,WiTCOM,Wiesbaden,2022-08-04T18:18:39.392004Z,205.6488933950454,24.203,253694035.70635754,23220505.965713702,,5.146.68.185