Git Product home page Git Product logo

nagios-plugin-file-ages-in-dirs's Issues

Check files in subfolders

Can this script check files in a sub-folders ? I have a backup server under linux but after the backup path the system creates random folder (like 017ac7de-0c21-3bd3-a30c-8c217c3e62f3) and then dates. I did /path/to/folder/* but I'm not sure if this is working.

unexpected operator while running this script

Hi,

I tried this script without any arguments (only -d was given). Everytime I run this script I got an error, it doesn't matter how many files there were in this directory:

  • without files:
    $ ./check_file_ages_in_dirs.sh -d /tmp/test/
    ./check_file_ages_in_dirs.sh: 341: [: unexpected operator
    OK: 1 dir(s) -- /tmp/test/: 0 files
  • with one file:
    $ ./check_file_ages_in_dirs.sh -d /tmp/test/
    ./check_file_ages_in_dirs.sh: 336: [: unexpected operator
    ./check_file_ages_in_dirs.sh: 341: [: unexpected operator
    OK: 1 dir(s) -- /tmp/test/: 1 files
  • with two files:
    $ ./check_file_ages_in_dirs.sh -d /tmp/test/
    ./check_file_ages_in_dirs.sh: 336: [: unexpected operator
    ./check_file_ages_in_dirs.sh: 336: [: unexpected operator
    ./check_file_ages_in_dirs.sh: 341: [: unexpected operator
    OK: 1 dir(s) -- /tmp/test/: 2 files
  • with three files:
    $ ./check_file_ages_in_dirs.sh -d /tmp/test/
    ./check_file_ages_in_dirs.sh: 336: [: unexpected operator
    ./check_file_ages_in_dirs.sh: 336: [: unexpected operator
    ./check_file_ages_in_dirs.sh: 336: [: unexpected operator
    ./check_file_ages_in_dirs.sh: 341: [: unexpected operator
    OK: 1 dir(s) -- /tmp/test/: 3 files

... and so on :)

I am using a bash with Ubuntu 15.10. Do you need something more?

Thanks in advance!

Not working on solaris 10

Hi, can you make it compatible with solaris ?
I have already worked on it, but i'm not a specialist.

For example, i had to modify :
#CURRENT_TIME=date +%s
CURRENT_TIME=nawk "BEGIN{print srand}"

#file_list=find $full_path -mindepth 1 -maxdepth 1 $file_types $ignore | sort
file_list=find $full_path $file_types $ignore | sort

#if [ "$OS_DISTRO" = "Linux" ]; then
#st_ctime=stat -c%Y ${next_filepath}
if [ "$OS_DISTRO" = "SunOS" ]; then
st_ctime=perl -e'print ((stat("${next_filepath}"))[9]);'

thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.