history delete

Vani3 years ago
mysql: [Warning] Using a password on the command line interface can be insecure.
mysql: [Warning] Using a password on the command line interface can be insecure.

i receive this message ?

Anton Tananaev3 years ago

And?

Vani3 years ago

how can i use this code:

cat > /etc/cron.daily/traccar-clear-database << EOF
#!/bin/bash
result=""
while [[ "$result" != *" 0 rows affected"* ]]; do
  result=$(mysql -u root -proot traccar -vve "DELETE FROM tc_positions WHERE fixTime < DATE(DATE_ADD(NOW(), INTERVAL -7 DAY)) AND id NOT IN (SELECT positionId FROM tc_devices WHERE positionid IS NOT NULL) LIMIT 10000")
  sleep 1
done
result=""
while [[ "$result" != *" 0 rows affected"* ]]; do
  result=$(mysql -u root -proot traccar -vve "DELETE FROM tc_events WHERE eventTime < DATE(DATE_ADD(NOW(), INTERVAL -7 DAY)) LIMIT 10000")
  sleep 1
done
EOF
chmod +x /etc/cron.daily/traccar-clear-database

i receive

mysql: [Warning] Using a password on the command line interface can be insecure.
mysql: [Warning] Using a password on the command line interface can be insecure.
Anton Tananaev3 years ago

I don't understand the problem. You run the code. Those warnings are expected. What is the issue exactly?