Operating System - HP-UX
1821638 Members
3127 Online
109633 Solutions
New Discussion юеВ

cron temporary files in /var/tmp

 
SOLVED
Go to solution
eric stewart_2
Advisor

cron temporary files in /var/tmp

I have found that when a script runs via cron and an echo is done to notify the user of a situation a file is left in /var/tmp.
Her are the date time of the files in /var/tmp:
-rw------- 1 daemon other 0 Jan 14 05:25 baaa26090
-rw------- 1 daemon other 0 Jan 14 05:25 aaaa26088
-rw------- 1 daemon other 0 Jan 14 04:54 baaa23039
-rw------- 1 daemon other 0 Jan 14 04:54 aaaa23037
-rw------- 1 daemon other 0 Jan 14 04:19 baab19173
-rw------- 1 daemon other 0 Jan 14 04:19 aaaa19171
-rw------- 1 daemon other 0
And here are the date time stamps of the emails from your id:
N 30 root Mon Jan 14 04:19 35/1131 cron
N 31 root Mon Jan 14 04:54 35/1131 cron
N 32 root Mon Jan 14 05:25 35/1131 cron

Any ideas of how to avoid these left over files.
I would rather cron clean them up than have another cron removed files in this directory older than say 7 days!
TIA
4 REPLIES 4
John Palmer
Honored Contributor

Re: cron temporary files in /var/tmp

Are these files being created by something that your cron script is running?

Cron writes it's log files to /var/spool/cron/tmp

Regards,
John
Helen French
Honored Contributor

Re: cron temporary files in /var/tmp

Steve Steel
Honored Contributor
Solution

Re: cron temporary files in /var/tmp

Hi

When an echo occurs in a cron script unless there is I/O redirection then the system calls the dafault mailer,(Often elm) and sends a message to the owner of the crontab.

There are recorded cases of files in /var/tmp
coming from the mailer started by cron.It is generally because of the use of address aliasing.

example

A customer has /var/tmp symlinked to /tmp. sendmail puts files
into /tmp that are zero length. Matching timestamps to the
mail.log shows two sample files associated with expanding an
alias list using :include: and another file associated with
forwarding through a pipe. The customer just had to clean up
over 123,272 such zero-length files. Why isn't sendmail cleaning
these up automatically?

he uses .forward files in conjunction with Elm filters and it is this not sendmail which causes the problem.

. They are using a non-HP filtering mechanism, so
their filtering is unsupported & probably the cause of their zero-length
file problems.


Hope this points you in the right direction.


Steve Steel
If you want truly to understand something, try to change it. (Kurt Lewin)
eric stewart_2
Advisor

Re: cron temporary files in /var/tmp

Steve,
I should have tested your theory and given 10 points.
I removed the .forward file and the empty files in /var/tmp do not show up any more.
I wonder how come HP can not change the way cron sends the messages so that when a .forward file is present the /var/tmp files will automatically be removed when not needed.
Thanks again