<span id="result_box" class="" lang="en"><span title="Cliquer ici pour voir d&#39;autres traductions" class="hps">Hello,<br>I have a problem with the fetch command.<br>I want to recover the data stored for a period . This period is given as an argument of the script, to check for a varous peroids </span></span><span id="result_box" class="" lang="en"><span title="Cliquer ici pour voir d&#39;autres traductions" class="hps">such 1 hour,1day,1week......</span></span><br>
<span id="result_box" class="" lang="en"><span title="Cliquer ici pour voir d&#39;autres traductions" class="hps">the problem is ,when I do the subtraction of this period to the present timestamp does not work .</span></span><br>
<br>$rrdtool fetch power.rrd AVERAGE -s 1h<br><br>end=$(date +%s)<br>time=$2 =1h<br>let &quot;start=($end-$time)&quot;<br><br>ERROR: start time: unparsable trailing text: &#39;...h&#39;<br> 
start time: There should be number after &#39;-&#39;<br>
<br><br><br><b>if i change 1h by 3600seconds <br></b><br>$rrdtool fetch power.rrd AVERAGE -s 3600<br>
<br>ERROR: start time: did you really mean month 3600?<br><br><b>I tried to change subtraction by addition</b><br><br>$rrdtool fetch power.rrd AVERAGE -s 1h<br><br>end=$(date +%s)<br>
time=$2 =1h<br>
let &quot;start=($end+$time)&quot;<br><br>./hist-conso.sh: line 34: let: start=(1309513267+-1h: value too great for base (error token is &quot;1h&quot;)<br><br><b>but with 3600 it works </b><br><br>$rrdtool fetch power.rrd AVERAGE -s 3600<br>
<br><span id="result_box" class="" lang="en"><span title="Cliquer ici pour voir d&#39;autres traductions" class="hps">I want to keep addition,but i can not</span> <span title="Cliquer ici pour voir d&#39;autres traductions" class="hps">convert</span> <span title="Cliquer ici pour voir d&#39;autres traductions" class="hps">each time</span> <span title="Cliquer ici pour voir d&#39;autres traductions" class="hps">period</span><span class="" title="Cliquer ici pour voir d&#39;autres traductions"> to seconds, especially if</span> <span title="Cliquer ici pour voir d&#39;autres traductions" class="hps">I use</span> <span title="Cliquer ici pour voir d&#39;autres traductions" class="hps">a</span> <span title="Cliquer ici pour voir d&#39;autres traductions" class="hps">very long</span> <span title="Cliquer ici pour voir d&#39;autres traductions" class="hps">time</span><span class="" title="Cliquer ici pour voir d&#39;autres traductions">.</span></span><br>
<br>Thank you very much.<br>best wishes<br>