创建
if [ ! -d /opt/dbspace ] then mkdir /opt/dbspace fi if [ -f /opt/dbspace/.memo.db ] then rm /opt/dbspace/.memo.db; fi if [ -f /opt/dbspace/.memo.db-journal ] then rm /opt/dbspace/.memo.db-journal fi sqlite3 /opt/dbspace/.memo.db 'PRAGMA journal_mode = PERSIST; create table memo_list ( memo_id INTEGER PRIMARY KEY AUTOINCREMENT, is_selected INTEGER default 0, time INTEGER default 0, year INTEGER default 0, month INTEGER default 0, day INTEGER default 0, hour INTEGER default 0, minute INTEGER default 0, wday INTEGER default 0, thumb_path TEXT NOT NULL, memo_text TEXT, image_path TEXT, image_x INTEGER, image_y INTEGER, image_w INTEGER, image_h INTEGER, handwrite_path TEXT, record_path TEXT, record_length INTEGER, UNIQUE (memo_id) ); ' chown :5000 /opt/dbspace/.memo.db chown :5000 /opt/dbspace/.memo.db-journal chmod 660 /opt/dbspace/.memo.db chmod 660 /opt/dbspace/.memo.db-journal chsmack -a 'memo::db' /opt/dbspace/.memo.db*