B<rrdtool> B<create> I<filename>
S<[B<--start>|B<-b> I<start time>]>
S<[B<--step>|B<-s> I<step>]>
+S<[B<--no-overwrite>]>
S<[B<DS:>I<ds-name>B<:>I<DST>B<:>I<dst arguments>]>
S<[B<RRA:>I<CF>B<:>I<cf arguments>]>
Specifies the base interval in seconds with which data will be fed
into the B<RRD>.
+=head2 B<--no-overwrite>
+
+Do not clobber an existing file of the same name.
+
=head2 B<DS:>I<ds-name>B<:>I<DST>B<:>I<dst arguments>
A single B<RRD> can accept input from several data sources (B<DS>),
#include "rrd_hw.h"
#include "rrd_is_thread_safe.h"
+static int opt_no_overwrite = 0;
#ifdef WIN32
# include <process.h>
struct option long_options[] = {
{"start", required_argument, 0, 'b'},
{"step", required_argument, 0, 's'},
+ {"no-overwrite", no_argument, 0, 'O'},
{0, 0, 0, 0}
};
int option_index = 0;
opterr = 0; /* initialize getopt */
while (1) {
- opt = getopt_long(argc, argv, "b:s:", long_options, &option_index);
+ opt = getopt_long(argc, argv, "Ob:s:", long_options, &option_index);
if (opt == EOF)
break;
pdp_step = long_tmp;
break;
+ case 'O':
+ opt_no_overwrite = 1;
+ break;
+
case '?':
if (optopt != 0)
rrd_set_error("unknown option '%c'", optopt);
rrd_t rrd_dn;
unsigned rrd_flags = RRD_READWRITE | RRD_CREAT;
+ if (opt_no_overwrite) {
+ rrd_flags |= RRD_EXCL ;
+ }
+
unkn_cnt = 0;
for (i = 0; i < rrd->stat_head->rra_cnt; i++)
unkn_cnt += rrd->stat_head->ds_cnt * rrd->rra_def[i].row_cnt;
N_("* create - create a new RRD\n\n"
"\trrdtool create filename [--start|-b start time]\n"
"\t\t[--step|-s step]\n"
+ "\t\t[--no-overwrite|-O]\n"
"\t\t[DS:ds-name:DST:dst arguments]\n"
"\t\t[RRA:CF:cf arguments]\n");