Nagios Exchange
  • Home
  • Directory
  • About

Advanced Search

Build precise queries to find exactly what you need

Search Logic

Select compatible versions

Press ESC to close

Sign In Sign Up
Plugins4387Themes and Skins11Add-ons732Documentation283Graphics and Logos36View All Categories
LinuxSecuritySNMPFile SystemCloud
New Listings Recently Updated Listings Most Favored Listings Most Popular Listings Most Rated Listings Most Reviewed Listings
Random Project
Environmental Sensaphone IMS-4000 (check_ims_sensor)
5.0 (2)
7.7K
RSS Feed
Newest Listings Updated Listings
Top Contributors
LAMY (7)Julien DESMAREST (6)deskwork_itunes142 (4)Davide Lemma (4)Joerg Hoerter (3)
See More
Newest Contributors
Guillaume8723 (1)Salvo (1)SOHA-IT (1)Tsvetomir Tsvetanov (1)Igor Ru (1)
See More
Home > Cristian
C

Cristian

@BARRESOFT

User Stats

Favorites0

Views0

Projects2

check_path_exists
Operating Systems
check_path_exists
Simple script to check path exists on linux. Remember that you can check windows/other filesystems paths using NFS/SAMBA/SMB/OTHER mounting point. Enjoy it!
0.0 (0)
45.2K
0
Cristian
GPL
check_smb_file_simple
SMB
check_smb_file_simple
Simple script to test a samba share. You can use is to test if a file exists on a windows domain. Usage: $PROGNAME -H -W…
4.0 (2)
45.8K
0
Cristian
GPL
check_newest_file_age

Modification to do it recursive, and support blank/white spaces between files/paths names!!!

If you want to do it recursive, use find to locate the indicated directory most recent file (on the tree). Then, take the file, and break the loop, indicate that the next file (the most recent unique file) is the find result file. Here is an example code, of modificated lines, excluding *.ini, *.tm? and *.db files: # Loop through each provided directory. for dir in $dirs do check_file= let "DIR_COUNT += 1" > /dev/null # Check if dir exists. full_path=${base_dir}${dir} #Agregado por Cristian Barreto full_path_archivo=`find $full_path -not -name "*.tm?" -not -name "*.ini" -not -name "*.db" $ indiceBarra=`expr match "$full_path_archivo" ".*/"` full_path=`echo $full_path_archivo | cut -c 1-$indiceBarra` #FIN del agregado if [ -d "$full_path" ]; then file_list=$full_path_archivo # Cycle through files, looking for a checkable file. for next_file in "$file_list" do next_filepath=$full_path_archivo if [ "$check_dirs" ]; then # Check if it's a file or directory. if [ -f "$next_filepath" ] || [ -d "$next_filepath" ]; then check_file=1 fi . . . . break #at the end of loop done -------------------------------- done!, remember that $next_filepath must have "$next_filepath" and "${next_filepath}" to support file names with blank spaces like Windows file names. Sorry for my bad english.

Reviewed 13 years ago

No Favorites Found

Copyright © 2009-2025 Nagios Enterprises, LLC. All rights reserved.

Privacy PolicyTerms of UseTrademarks