Subj : Re: Basic script help To : Avon From : Zip Date : Sun Aug 01 2021 09:44 am Hello Avon! On 01 Aug 2021, Avon said the following... Av> What I want to do is run something at Agency so when new files land in my Av> inbound a .sh script is run and tests are performed such that if it's a Av> Galactic Dynasty file then the script runs GD maint, if it's a For Honour Av> file it runs FH maint etc.. you get the idea. I think the 'find' command will come in handy here. Are there any specific filename patterns which can be detected for each of those? Just as an example, although pointing it at my *outbound*, because that's the only place where I have some status files lying around: if [ ! -z "$(find /mnt/bbs/echomail/out/ -xdev -type f -name '*.sts' -print -quit)" ]; then echo "Found something"; fi This will search for *.sts files under /mnt/bbs/echomail/out, and echo a string if it found some. That's where you would call your script(s). The directory/path *should* have a trailing slash as in the example to avoid symlink diversion (not very likely but anyway). And the -xdev is another safeguard against descending (probably by mistake, or by symlinks) into other file systems, which probably is not desired. The way this works is that 'find' will locate any matching file(s), print the name of the first one (only), and immediately quit after that. This results in a non-empty string as output, which 'if' checks for. And, if found, does something. The 'find' command can be fine-tuned a lot. E.g.: * "-iname" instead of "-name" for case-insensitive searches. * "-mindepth 1 -maxdepth 9" after "-xdev" to restrict to files inside that base directory and max 9-1=8 subdirectories down. * "-regextype egrep" after "-xdev" and replacing "-name" with something like "-regex '.*\/[^.]+\.(mo[0-9a-z]|MO[0-9A-Z]|tu[0-9a-z]|TU[0-9A-Z]|we[0-9a-z]|WE[0-9A-Z] |th[0-9a-z]|TH[0-9A-Z]|fr[0-9a-z]|FR[0-9A-Z]|sa[0-9a-z]|SA[0-9A-Z]|su[0-9a-z]|S U[0-9A-Z])$'" to use regular expressions for the filename (actually, the entire path to the file). The example would check for packet files with either (all) lowercase or (all) uppercase extensions. Hope this helps! Best regards Zip P.S. I think you could make your binkd run your find script after each session with something like this in binkd.cfg: exec "/path/to/your/find_script.sh" * *.* Hmm, if the files have known extensions then maybe you could let binkd call the appropriate maintenance scripts directly without using 'find' at all? exec "/path/to/your/fh_maint.sh" *.fh *.FH exec "/path/to/your/gd_maint.sh" *.gd *.GD D.S. --- Mystic BBS v1.12 A47 2021/07/31 (Linux/64) * Origin: Star Collision BBS, Uppsala, Sweden (21:1/202) .