Ticket #250 (closed enhancement: fixed)

Opened 2 years ago

Last modified 2 years ago

Prevent accidental overwrite on create rrd file

Reported by: human Owned by: oetiker
Priority: minor Milestone:
Component: rrd_create Version: 1.2.33
Keywords: overwrite create Cc: tobi@…

Description

the default seems to be that rrd_create overwrites existing .rrd files - i guess this cant be changed - but how about a flag "-nooverwrite" to error if the rrd file already exists?

Attachments

rrdtool-1.3.8-create-no-overwrite.patch Download (2.0 KB) - added by human 2 years ago.
Working version of 1.3.8 patch
rrdtool-1.4.2-create-no-overwrite.patch Download (2.8 KB) - added by human 2 years ago.
working version of 1.4.2 patch

Change History

comment:1 Changed 2 years ago by oetiker

  • Status changed from new to closed
  • Resolution set to worksforme

Hi,

if you feel like implementing such a check (someone contributed this for rrd_restore once) I'll be glad to integrate it ...

cheers tobi

comment:2 Changed 2 years ago by human

  • Cc tobi@… added
  • Status changed from closed to reopened
  • Resolution worksforme deleted

Find attached patch to add --no-overwrite to rrd create two versions, one for 1.3.8 and one for 1.4.2 using rrd_open

Please add to distribution.

comment:3 Changed 2 years ago by human

Sorry - this doesn't work. It doesn't overwrite but it doesn't create either - Doh.

Changed 2 years ago by human

Working version of 1.3.8 patch

Changed 2 years ago by human

working version of 1.4.2 patch

comment:4 Changed 2 years ago by human

New versions should now work.

added --no-overwrite flag to rrdcreate that adds O_EXCL flag to the open call so it will fail with EEXIST if the file already exists.

Please add to distribution.

comment:5 Changed 2 years ago by oetiker

  • Status changed from reopened to closed
  • Resolution set to fixed

thanks, I have added this as r2028

Note: See TracTickets for help on using tickets.

NOTE: The content of this website is accessible with any browser. The graphical design though relies completely on CSS2 styles. If you see this text, this means that your browser does not support CSS2. Consider upgrading to a standard conformant browser like Mozilla Firefox or Opera but also Apple's Safari or KDE's Konqueror for example. It may also be that you are looking at a mirror page which did not copy the CSS for this page. Or if some pictu res are missing, then the mirror may not have picked up the contents of the inc directory.