Operating System - HP-UX
1752770 Members
5001 Online
108789 Solutions
New Discussion юеВ

Change of folder/directory size required a mail

 
malise
New Member

Change of folder/directory size required a mail

Hello All,

I want to know in my ftp location whether the file is existed or not , if existed needs to send mail.

This should not configured in crontab after writing script and it should not be uitlise much resources

Automatically it needs to check of the folder/directory size like a trigger and it sholud send a mail

is there any command in HP-UX for this ? or any solution please help me

Thanks in advance

Regards,
Mali
5 REPLIES 5
Shibin_2
Honored Contributor

Re: Change of folder/directory size required a mail

If you have any monitoring tools installed, utilize that.

Otherwise, without cron / other scheduled job, how you can expect to run a script to check automatically ?
Regards
Shibin
James R. Ferguson
Acclaimed Contributor

Re: Change of folder/directory size required a mail

Hi:

> Automatically it needs to check of the folder/directory size like a trigger and it sholud send a mail

Checking the number of blocks allocated to a directory, or its size in bytes, or whether its overall content size (as with 'du -s') increases or decreases) isn't going to help you.

From your meager description, it sounds like you know when a file is added or changed in your directory. For that, you could write a script that records the most recently modified file's timestamp; sleeps for some period; awakens and compares the most recently modified file timestamp to what it last remembered. If newer, send an email.

Regards!

...JRF...
malise
New Member

Re: Change of folder/directory size required a mail

Thanks alot for the reply
Viktor Balogh
Honored Contributor

Re: Change of folder/directory size required a mail

> Otherwise, without cron / other scheduled job, how you can expect to run a script to check automatically ?

this sounds like an endless while loop...


while true
do
check_what_was_changed
sleep $SOMETIME
done
****
Unix operates with beer.
malise
New Member

Re: Change of folder/directory size required a mail

thanks alot