=head1 SYNOPSIS
-B<rrdtool> B<dump> I<filename.rrd> E<gt> I<filename.xml>
+B<rrdtool> B<dump> S<[B<--no-header>|B<-n>]> I<filename.rrd> E<gt> I<filename.xml>
or
-B<rrdtool> B<dump> I<filename.rrd> I<filename.xml>
+B<rrdtool> B<dump> S<[B<--no-header>|B<-n>]> I<filename.rrd> I<filename.xml>
=head1 DESCRIPTION
convenient manner.
-
=over 8
=item I<filename.rrd>
The (optional) filename that you want to write the XML output to.
If not specified, the XML will be printed to stdout.
+=item S<[B<--no-header>|B<-n>]>
+
+In rrdtool 1.3, the dump function started producing correct xml-headers.
+Unfortunately the rrdtool restore function from the 1.2 series can not
+handle these headers. With this option you can supress the creatinon of
+the xml headers.
+
=back
=head1 EXAMPLES
out_file = stdout;
}
- if (opt_noheader){
+ if (!opt_noheader){
fputs("<?xml version=\"1.0\" encoding=\"utf-8\"?>\n", out_file);
fputs
("<!DOCTYPE rrd SYSTEM \"http://oss.oetiker.ch/rrdtool/rrdtool.dtd\">\n",
}
} /* while (42) */
- if ((argc - optind) < 2) {
+ if ((argc - optind) < 1 || (argc - optind) > 2) {
rrd_set_error("usage rrdtool %s [--no-header|-n] "
"file.rrd [file.xml]", argv[0]);
return (-1);
}
- if (argc == 3) {
- rc = rrd_dump_opt_r(argv[1], argv[2],opt_noheader);
+ if ((argc - optind) == 2) {
+ rc = rrd_dump_opt_r(argv[optind], argv[optind+1],opt_noheader);
} else {
- rc = rrd_dump_opt_r(argv[1], NULL,opt_noheader);
+ rc = rrd_dump_opt_r(argv[optind], NULL,opt_noheader);
}
return rc;