=item B<-w> I<timeout>
-Data is written to disk every I<timeout> seconds. If this option is not
+Data is written to disk every I<timeout> seconds.
+An L<optional suffix|librrd/rrd_scaled_duration> may be used
+(e.g. C<5m> instead of C<300> seconds).
+If this option is not
specified the default interval of 300E<nbsp>seconds will be used.
=item B<-z> I<delay>
If specified, rrdcached will delay writing of each RRD for a random number
of seconds in the rangeE<nbsp>[0,I<delay>). This will avoid too many
writes being queued simultaneously. This value should be no greater than
-the value specified in B<-w>. By default, there is no delay.
+the value specified in B<-w>.
+An L<optional suffix|librrd/rrd_scaled_duration> may be used
+(e.g. C<3m> instead of C<180> seconds).
+By default, there is no delay.
=item B<-f> I<timeout>
Every I<timeout> seconds the entire cache is searched for old values which are
written to disk. This only concerns files to which updates have stopped, so
setting this to a high value, such as 3600E<nbsp>seconds, is acceptable in most
-cases. This timeout defaults to 3600E<nbsp>seconds.
+cases.
+An L<optional suffix|librrd/rrd_scaled_duration> may be used
+(e.g. C<1h> instead of C<3600> seconds).
+This timeout defaults to 3600E<nbsp>seconds.
=item B<-p> I<file>
{
int option;
int status = 0;
+ const char *parsetime_error = NULL;
socket_permission_clear (&default_socket);
case 'f':
{
- int temp;
+ unsigned long temp;
- temp = atoi (optarg);
- if (temp > 0)
- config_flush_interval = temp;
- else
- {
- fprintf (stderr, "Invalid flush interval: %s\n", optarg);
+ if ((parsetime_error = rrd_scaled_duration(optarg, 1, &temp))) {
+ fprintf(stderr, "Invalid flush interval %s: %s\n", optarg, parsetime_error);
status = 3;
+ } else {
+ config_flush_interval = temp;
}
}
break;
case 'w':
{
- int temp;
+ unsigned long temp;
- temp = atoi (optarg);
- if (temp > 0)
- config_write_interval = temp;
- else
- {
- fprintf (stderr, "Invalid write interval: %s\n", optarg);
+ if ((parsetime_error = rrd_scaled_duration(optarg, 1, &temp))) {
+ fprintf(stderr, "Invalid write interval %s: %s\n", optarg, parsetime_error);
status = 2;
+ } else {
+ config_write_interval = temp;
}
}
break;
case 'z':
{
- int temp;
+ unsigned long temp;
- temp = atoi(optarg);
- if (temp > 0)
- config_write_jitter = temp;
- else
- {
- fprintf (stderr, "Invalid write jitter: -z %s\n", optarg);
+ if ((parsetime_error = rrd_scaled_duration(optarg, 1, &temp))) {
+ fprintf(stderr, "Invalid write jitter %s: %s\n", optarg, parsetime_error);
status = 2;
+ } else {
+ config_write_jitter = temp;
}
-
break;
}