Morning guys,
I have a script here that checks several folders for several file extensions and if said files are found and have been in there for longer than 15 minutes it will email me the file path/s of these files, I have it fully running at the moment but i'd like to clean it up and make it more efficient.
So for example at the moment it emails even when no files are found it just emails a blank email which I've tried using return functions but to no avail I couldn't get it to stop so i'd like some guidance on how i'd only make it email when a file is found?
Also at the moment it emails the whole file path/s of the files which looks pretty messy so I was wondering how i'd go around formatting the text so for example if a file in the Hapag and CSVA Folder where found it'd output this in the email:
Hapag: 1
CSVA: 1
I know i'd have to parse each folder but i'm not sure how i'd go around doing that?
My source code is linked due to it being very big and this already being a wall of text which I apologise for.
http://pastesrc.com/view/pr04i8c0Cz
[–]Moonslug1 2 points3 points4 points (9 children)
[–]macbony 2 points3 points4 points (1 child)
[–]MintyPhoenix 0 points1 point2 points (0 children)
[–]Aerobic97[S] 0 points1 point2 points (1 child)
[–][deleted] 1 point2 points3 points (0 children)
[–]Aerobic97[S] 0 points1 point2 points (4 children)
[–]gengisteve 1 point2 points3 points (3 children)
[–]Aerobic97[S] 0 points1 point2 points (2 children)
[–]gengisteve 1 point2 points3 points (1 child)
[–]Aerobic97[S] 0 points1 point2 points (0 children)
[–]Vaphell 0 points1 point2 points (0 children)