Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Append only file

I'm trying to realize a file. Each event just appends one line to the file. So far this is a no brainer. The hard part is that several users are supposed to be able to add entries to that file but no one is supposed to be able to modify or delete existing ones. Can I somehow enforce this using file access rights? I'm using Linux.

Thx

like image 384
Ben Avatar asked Aug 30 '10 23:08

Ben


People also ask

What is append-only in Redis?

The append-only file is an alternative, fully-durable strategy for Redis. It became available in version 1.1. You can turn on the AOF in your configuration file: appendonly yes. From now on, every time Redis receives a command that changes the dataset (e.g. SET ) it will append it to the AOF.

What does append-only mean access?

The append only property basically allows you to track history for the field. With this property set to Yes, you can still add, edit, and delete data in the field. It just allows you to then right click on the field and choose “Show Column History” and see all of the changes that have been made to that field.

How do I make a file only append in Linux?

1.1 The chflags command. The superuser can make any file immutable or append-only through the use of the chflags command. This example makes the kernel immutable and the file /var/log/messages append-only: In Linux, the chattr command is used to modify these flags.

What is append-only table?

Append-Only Replication is a type of Incremental Replication where newly replicated data is appended to the end of a table. Existing rows are not updated - any updates will be added to the table as new rows.


1 Answers

On linux you have the option of using the system append-only flag. This is not available on all filesystems.

This attribute is set using the chattr utility and you should view the man page. Only root can set this attribute.

On Ubuntu you'll probably end up doing: sudo chattr +a filename

like image 194
Justin Simms Avatar answered Oct 01 '22 11:10

Justin Simms