Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

check_files #369

airathere started this conversation in General
Discussion options

is there a possibility to use check_files to determine, if a file age is correct when several files in a directory exists?

e.g.:
directory "/backups/somefiles" has 7 files (7 days written at 22:50, after 7 days they will be overwritten)

if i use check_files with age-parameter like that

check_files -a path="/backups/somefiles" pattern="*.gz" filter="age > 23h" crit="count > 0" empty-state=0 empty-syntax="no old files found"

i get:
critical - 0/6 files

which is correct but not useful.
Better will be to have a parameter like "check-only-latest-file"

the directory looks like this:

-rw------- 1 root root 29809 Apr 12 22:50 0.sql.tar.gz
-rw------- 1 root root 29809 Apr 13 22:50 1.sql.tar.gz
-rw------- 1 root root 29809 Apr 14 22:50 2.sql.tar.gz
-rw------- 1 root root 29807 Apr 15 22:50 3.sql.tar.gz
-rw------- 1 root root 29809 Apr 16 22:50 4.sql.tar.gz
-rw------- 1 root root 29809 Apr 10 22:50 5.sql.tar.gz
-rw------- 1 root root 29809 Apr 11 22:50 6.sql.tar.gz

so only "4.sql.tar.gz" is of interest here.

Thanks for all helps!
Joe

You must be logged in to vote

Replies: 1 comment

Comment options

you could use either show-all to show all files or adjust the ok-syntax to show a more useful message. A check-only-latest-file parameter seems a bit overspecific. Maybe one day we could add
sort, limit and offset parameter to further customize the result list.

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants

AltStyle によって変換されたページ (->オリジナル) /