def sql_check_consistency(cursor):
    """
    Checks for file consistency. Things can and will get corrupted, often by copying
    while the file is being written into by another process. This seems to be hard to
    recover from. Sooo... MAKE BACKUPS!

    :param cursor: sqlite3 db cursor
    :return: Status of db. Either "ok" or some error message, likely corrupted file.
    """
    return cursor.execute('pragma integrity_check').fetchone()[0]