I don't see data older than 72h - grafana

i have problem with my graphite (I think so)
when i set eg. CPU-system diagram to 72h is all ok, i see data etc.
when i set more than 72 - eg. 73 or 73-89h from this moment i see empty graph
I can't even see the latest data 72h
I try change storage-schemas.conf eg.
[default_1min_for_2weeks]
pattern = .*
retentions = 10s:100h,5m:168d,10m:1y
I try change by this option
find /var/lib/carbon/whisper-ng/* -type f -name '*.wsp' -exec whisper-resize --nobackup {} 10s:100h 5m:160d 10m:1y \; -exec chown carbon:carbon \;
but sometimes it help, but not for long after couple days problem is back
Interestingly, it works normally on some charts (all data from collectd)
Graphite-web 1.2.0DEV
go-carbon 0.13.0

Related

How can I show output of a command in real time using Swift?

All the solutions I've found so far don't work with find command like these. For some reason the output doesn't get flushed immediately with even line separators '\n'.
Example for command: find ~/ ! -path '/Users/username//Library/*' -type f -size +2G
I just want to get real-time output from that command, the output can be seen in terminal in real-time but from all methods like mentioned above I've tried it waits till end of execution then flushes all output.

How can I stop find from searching a dir tree once it finds a match?

This is a variant of "How can I stop find from searching after first result found?" which I posted earlier today but is different enough to warrant a new question (IMO). It involves the find command ant potentially a perl soln if find can't do what I need.
Using find, I want to search a dir tree for all instances of dirs with name "out". Once an instance of "out" is found, I want it to stop searching under that dir but keep searching other paths for "out".
Consider this example...
mkdir -p top/a/b/out/c/d/out/e/leaf
mkdir -p top/a/bb/cc/out/dd/ee/out/ff/gg/out/hh/leaf
I want to find...
top/a/b/out
top/a/bb/cc/out
... but no other instances of "out".
Also, I want it to stop searching (wasting time) once it hits an instance of "out" in a path.
I am going to run this in perl, so I suppose I could get creative and write some recursive func to do this. And so I will also tag this with question with "perl" should that be the eventual solution.
Use the -prune action:
find top -name out -print -prune
This action prevents find from recursing into a directory.

Dynamically change find -maxdepth value given specific subdirectoy name

tl:dr I am trying to get find to completely ignore a specific subdirectory regardless of depth.
I am asking this question in reference to a line of code from maldets open source. It is the find command that generates the filelist that the scanner is to examine.
I know find will start at whatever dir specified, at a given maxdepth value.
Is it possible to change the maxdepth level at say dir/subdir/Thisleveldir so that when using the flag -D search nothing below Thisleveldir/ is listed?
For instance I want to search the /home directory to a max depth of 15
find /home -maxdepth 15 -type f -size +100M
until the pwd is /home/user/ReallyHugeDirThatDoesntNeedToBeSearched/ at which point -maxdepth gets set to 1
then once the pwd again is not that specific subdirectory -maxdepth reverts to its previous value of 15.
Is this possible?

day difference between dates and check convert the text in date

My intention of writing a shell-script (ksh) is to list all the files in a directory and check the creted date. If the date exceeds 30 days, the files are zipped in another location.
ksh code :
--extracts the day and date of the file
ls -al | awk '{print $6$7}'
output
May23 Jun13 .......
Now, when i extract the day and date, i believe it is in text. Now, my requirement is to change the text into date and check the created date whether less than 30 days or greater.
However, i googled out an found some good suggestions but none satisfoes mine(as far as i searched).
Could you please suggest as what is required to do?
Thanks in advance.
Don't use ls for this. Use find, e.g.
find . -type f -ctime +30
or similar-type command.

ClearCase: How to find elements that do NOT have a particular label

I'm looking for a ClearCase command that will list all the elements that are visible in my current view, but do NOT have a particular label applied to them.
Say for example, most of the elements that are visible in my view have LABEL_X applied to them. I want a list of those elements that do not have LABEL_X.
I obviously need to use cleartool find, but the usage and ClearCase man page baffle me in terms of how to construct a query like this.
This should work:
ct find -all -ele '! lbtype_sub(LABEL_X)' -print
ct find -ele '! lbtype_sub(LABEL_X)' -print
Notes:
ct stands for cleartool
Unix syntax here (for windows, replace simple quotes with double quotes)
beware of the space between ! and lbtype_sub (in winodws you do not need the space)
-ele very IMPORTANT to get only one occurrence of a given file (and not all the different versions of a file matching a criteria)
-ele limits the search to elements, not versions (that would trigger a lot more results with versions involved...)
-all list all elements included "deleted" (that is "unreferenced") ones.
The second line lists only visible elements (in the current view)
You should execute those second command lines on the sub-directory of your choice within a given ClearCase (snapshot or dynamic view): all files within that sub-directory (and sub-sub directories...) matching the cirteria will be listed.
Warnings:
files and directories are listed. If you want only files, add -type f to the query:
ct find -type f -ele '!lbtype_sub(LABEL_X)' -print
what is displayed is the extended path for elements, that is the name of the file followed with ##.
To list only the name without ##, use '-nxn' (no extendedpathname option)
ct find -nxn -ele '!lbtype_sub(LABEL_X)' -print
Another more complex but also more complete way to list only the name without ##, is to use descr -fmt. For instance:
ct find . -ele "!lbtype_sub(LABEL_X)" -exec "cleartool descr -fmt \"%En %d\n\" \"%CLEARCASE_PN%\""
ct find . -ele '! lbtype_sub(LABEL_X)' -exec 'cleartool descr -fmt "%En %d\n" "$CLEARCASE_PN"'
would give you (in windows or unix syntax) the date and name of the files and directories not labeled LABEL_X.
With that 'descr -fmt' display, you can combine any kind of information and presentation you want for the result.
Above works, but remember to specifiy -cview to get JUST the current view, otherwise you'll get files from all the other views as well.
I needed to use the following on my Linux clearcase install:
cleartool find -cview -all -version '\!lbtype(LABEL_X)' -print
The syntax from VonC's post did not work properly with the "!" not being escaped.