trying to correct data but getting attempt to write a readonly database

206 views
Skip to first unread message

jeremeyi

unread,
Oct 9, 2023, 11:43:20 PM10/9/23
to weewx-user
I am trying to get rid of a couple of rain rate errors in my database using the guide here


when I run 
echo "SELECT * FROM archive WHERE (rainRate > 10);" | sqlite3 /var/tmp/backup.sdb

it shows the two records I need to get rid of but when I run

echo "UPDATE archive SET rainRate=NULL WHERE (rainRate > 10);" | sqlite3 /var/tmp/backup.sdb

it says Error: near line 1: attempt to write a readonly database.  I have tried with sudo with the same results
 

michael.k...@gmx.at

unread,
Oct 10, 2023, 12:00:19 AM10/10/23
to weewx-user
What exactly did you type when you say:
>  I have tried with sudo with the same results

jeremeyi

unread,
Oct 10, 2023, 12:01:59 AM10/10/23
to weewx-user
sudo echo "UPDATE archive SET rainRate=NULL WHERE (rainRate > 10);" | sqlite3 /var/tmp/backup.sdb

michael.k...@gmx.at

unread,
Oct 10, 2023, 12:03:17 AM10/10/23
to weewx-user
Try
echo "UPDATE archive SET rainRate=NULL WHERE (rainRate > 10);" | sudo sqlite3 /var/tmp/backup.sdb

jeremeyi

unread,
Oct 10, 2023, 12:07:41 AM10/10/23
to weewx-user
that worked!!!  Thanks!
Reply all
Reply to author
Forward
0 new messages