nanch / tarbackup

Server config and scripts for creating tarbackup
19 stars 1 forks source link

lock access to userstocreate.txt from submit.php #4

Open nanch opened 11 years ago

nanch commented 11 years ago

writing to userstocreate.txt is not atomic and should be.

use a file lock (userstocreate.txt.lock) to guarantee that there is only one writer to the file at any given time.

reference: http://news.ycombinator.com/item?id=4561336

nanch commented 11 years ago

migrate createdusers.log and userstocreate.txt to sqlite3 and python scripts

this will add support for atomic operations, but will also add sqlite3 and python as dependencies

Database file: /usr/local/etc/tarbackup/db/tarbackup.db

createdusers.log will be migrated to table: Users

Users: Id, Name, Password, Email, Created

userstocreate.txt will be migrated to table: UsersToCreate

UsersToCreate: Id, Name, Password, Email, Created