Tag Archives: CRON

Perl Scripts using sendmail fails

By dedwinson

Here’s the deal. I have about 60 Perl scripts that run at various times during the month, most run daily. Each script is run via CRON under a service ID account.

All of the scripts create email notifications when they are complete, have errors, deliver files etc. This has been working for years but we just did a patch at the end of June and now the emails don’t work.

I have confirmed sendmail DOES work via command line. I also confirmed that the portions of the perl script that composes and sends email DOES work IF you are signed in under the service account ID.

For years we have other scripts that run via command line submission by users that also generate email notices. We have found that IF the user is still logged into the Unix box at the time of script completion, an email will appear in their MS Exchange email box. HOWEVER, if they log out and let the script run “nohup” there will be NO email delivered.

It seems to me that something has happened after the latest patch that changed and made the service account behave like an ordinary user account.

What I am looking for is WHAT would the setting(s) be that would cause any account to behave in this way and hopefully I can reverse what happened to our service account. These notifications are critical to our business.

…read more

Source: FULL ARTICLE at The UNIX and Linux Forums

Shell script to find size of subdirectories

By ankit2012Hi
I have to find size of subdirectory and automate it in CRON.

Eg: parent directory name is NVBKP inside it there are several subdirectories
I want to get the size of recent two subdirectories.

I have tried ls -ltr diretory path | tail -2
But it is providing only size of the folder not the contents of that folder.

For eg if there are 5 subdirectories in NVBKP say
a
b
c
d
e

then i need complete size of d and e.
say complete size of d and e is 25 gb
but when i am using ls -ltr directory path| tail -2 it is giving me only size of folder d and e i.e 256 mb or something but not its contents.

Kindly suggest.
Source: The UNIX and Linux Forums