Sponsored Content
Top Forums Shell Programming and Scripting HPUX - Sendmail and delete file Post 302280876 by rwuerth on Tuesday 27th of January 2009 05:49:02 PM
Old 01-27-2009
create a cron script that goes off at 23:55 every day that does the following:

1. get the highest numbered /tmp/bdfoutput.# file. I'm sure there are plenty of ways here's one off the top of my head:

Code:
FNUM=$(ls -1 /tmp/bdfoutput.* | sort -t. -k2nr | head -n 1 | cut -f2 -d. )

Note: in the 'ls -1' command that is "one" not "ell" as the option.

Should leave you with just the number in $FNUM

2. use mailx to send out /tmp/bdfoutput as the body of the mail message
to your recipient(s).

and then

Code:
((FNUM+=1))
mv /tmp/bdfoutput /tmp/bdfoutput.${FNUM}

Note2: If you write this as a cron script, make sure to fully qualify the paths to non built-in commands,
and don't have any debugging output in your final version that cron will use.

Last edited by rwuerth; 01-27-2009 at 07:14 PM.. Reason: added 'Note' and 'Note2'
 

10 More Discussions You Might Find Interesting

1. Programming

Document file reader for HPUX

Hi All, has anyone found any document file reader for HPUX? I have been finding myself in trouble without having one.. if there is nothing that exist, I am thinking of developing one of my own through C, Not being a professional C programmer, I need to have a good start.. can someone please throw... (0 Replies)
Discussion started by: sskb
0 Replies

2. Shell Programming and Scripting

.profile file error on HPUX 11.11

Hi, I am working on HPUX 11.11i and 11.10 boxes. My default shell is ksh. I have the following entry in my profile file HOSTNAME=`uname -n` Every time I login to the server, this is the error I get: ${HOME:-.}/.profile: syntax error: `)' unexpected The line number shown... (1 Reply)
Discussion started by: Yomaanmean
1 Replies

3. Shell Programming and Scripting

Need Script to Use CPUs on a HPUX server to simulate Workload Manager on HPUX.

I am running HPUX and using WLM (workload manager). I want to write a script to fork CPUs to basically take CPUs from other servers to show that the communication is working and CPU licensing is working. Basically, I want to build a script that will use up CPU on a server. Any ideas? (2 Replies)
Discussion started by: cpolikowsky
2 Replies

4. HP-UX

HPUx sendmail Question

why is that I need to go to /usr/sbin> in order to run send mail how can I run sendmail where ever folder I'm in... e.g. like /stuff/games/sendmail ksh: sendmail: not found (7 Replies)
Discussion started by: makaveli
7 Replies

5. UNIX for Dummies Questions & Answers

I/O performance in HPUX file systems

Hi guys, what is the relation between I/O performance and file systems. I have a file systems called /dcs/data01 which is having 4Tb size. According our application we can split the file system like dcs/data01 -> 1Tb dcs/data02 -> 1Tb dcs/data03 -> 1Tb dcs/data04 -> 1Tb do you... (4 Replies)
Discussion started by: Davinzy
4 Replies

6. UNIX for Dummies Questions & Answers

How to get timestamp of a file in HPUX

Hi All, Am trying to get a command which gives the "date + time" that a file was edited. I cant use "ls -l" because it fails to get me the "time stamp" of files that were edited more than 6 months ago...commands like "stat" "ctime" etc aren't available on my server and I can't install them... (12 Replies)
Discussion started by: n_rajitr
12 Replies

7. HP-UX

pwage-hpux-T for Trusted HPUX servers

I'm sharing this in case anybody needs it. Modified from the original solaris pwage script. This modified hpux script will check /etc/password file on hpux trusted systems search /tcb and grep the required u_succhg field. Calculate days to expiry and notify users via email. original solaris... (2 Replies)
Discussion started by: sparcguy
2 Replies

8. HP-UX

File descriptor directory in HPUX

Hi, In solaris I remember this direcotry structure /proc/<pid>/fd in this directory ls -l | wc -l would give me the number of file descriptor for that process. Where can I find the similar in HPUX (11 Replies)
Discussion started by: mohtashims
11 Replies

9. HP-UX

How to list file size on HPUX?

I used to use ls -l cut to detrmine file size, and google searches didn't come up with anything else but 'stat' which doesn't appear on HPUX. I discovered the humble 'wc -c' which does this job very neatly, and thought I would share it. (7 Replies)
Discussion started by: tbochan
7 Replies

10. HP-UX

Compile sendmail on hpux

The sendmail on hp site is too old,and still support the bugged ssl3(poodle) even if enable tlsv1. So i decide to compile sendmail by myself i use this site.config.m4 define(`confCClibsmi', `gcc -fPIC') define(`confCC',`/usr/local/bin/gcc -fPIC') define(`confOPTIMIZE', ` -O3')... (0 Replies)
Discussion started by: Linusolaradm1
0 Replies
FAXCRON(8)						      System Manager's Manual							FAXCRON(8)

NAME
faxcron - HylaFAX routine maintenance script SYNOPSIS
/usr/sbin/faxcron [ -n ] [ -l lastrun ] DESCRIPTION
faxcron is a command script that does routine upkeep tasks in a HylaFAX spooling directory hierarchy. This script is intended to be invoked from cron(8) on behalf of the fax user (often the ``fax'' user is uucp) once a day, with the standard output sent by mail to the HylaFAX administrator. For example, the following crontab might be set up for the fax user: 25 23 * * * sh /usr/sbin/faxcron | mail FaxMaster The faxcron script does the following work: o report statistics for facsimile transmitted since the last time faxcron was run. o report statistics for facsimile transmitted in the past week. o report statistics for facsimile received since the last time faxcron was run. o report statistics for facsimile received in the past week. o report any recent calls that failed suspiciously and return the associated trace log; o purge data that is 30 days or older from the remote machine information directory; o delete information that is 30 days or older from session trace log files; o remove files from the tmp directory that are older than 1 day; o remove files in the received facsimile queue that are 7 days or older; o report sites that are currently having jobs rejected; and o force all session log files to be owned by the fax user and kept with protection mode 644. OPTIONS
-n Forces faxcron to run without updating any files. -l lastrun Forces the notion of the last time that faxcron was run to be lastrun. The value of lastrun is a date and time string of the form ``MM/DD/YY HH:MM'' (the date(1) format string ``%D %H:%M''). -info n Set the expiration time for data in the info database to be n days. -log n Set the expiration time for session log data to be n days. -rcv n Set the expiration time for files in the received facsimile queue to be n days. -tmp n Set the expiration time for files in the tmp directory to be n days. -mode m Set the file protection mode for session logs to m (a command line argument to chmod(1)). NOTES
This script requires nawk(1) or gawk(1) and a date (1) program that supports the ``+format'' option. If session logs are to be kept private this script must be modified to filter out sensitive information such as calling card numbers. (It should also be run with ``-mode 0600'' so that session log files are not publicly readable.) FILES
/var/spool/hylafax spooling area /var/spool/hylafax/status/lastrun timestamp of last run /usr/sbin/xferfaxstats for generating transmit statistics /usr/sbin/recvstats for generating receive statistics /var/spool/hylafax/tmp/faxcronXXXX temporary file for truncating session logs /var/spool/hylafax/tmp/faxlogXXXX temporary file for logs of failed calls SEE ALSO
cron(8), faxq(8), faxgetty(8), faxsend(8), xferfaxstats(8), recvstats(8), hylafax-server(5) May 12, 1996 FAXCRON(8)
All times are GMT -4. The time now is 04:58 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy