10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I need a UNIX ksh script that counts the number of files in directory, if the files exceed 20 files, then email results. I want the script to run every hour.. I don't have access to cron.. I'm some what new to UNIX. Windows guy all my career.. this is what I have so far..
#!/bin/ksh
# count.sh
... (5 Replies)
Discussion started by: PerlHaven2k
5 Replies
2. Shell Programming and Scripting
Hello Everyone,
I am currently trying to write a Bash Script to call a PCAP file. The command I will use in the script will be the following:
tshark -r test.pcap -T fields -e frame.number -e frame.time -e eth.src -e eth.dst -e ip.src -e ip.dst -r ip.proto -E header=y -E separator=, quote=d -E... (4 Replies)
Discussion started by: MrTuxor
4 Replies
3. Shell Programming and Scripting
I have googled and searched and can't come up with anything that works for me, so I'll ask the experts on here...
I have a ksh script on UNIX, and a file on a Windows network drive. I need the script to get the file from the Windows network drive and save it in a folder on UNIX.
-This MUST... (4 Replies)
Discussion started by: dbiggied
4 Replies
4. Shell Programming and Scripting
I'm looking at a line in a script:
&& DRROOT="/dir1" || DRROOT="/dir2" I'm trying to understand it.
Is there a "-d" command and is it seeing if /dir1 exists and, if so, set an environment variable named DRROOT to "/dir1", else set DRROOT to "/dir2" ?
Thanks,
-dog
---------- Post... (0 Replies)
Discussion started by: landog
0 Replies
5. Shell Programming and Scripting
Hello,
I'm trying to move the log files from the parent directory to respective monthly folder and I would be running this script on a weekly basis through cron.
I'm new to this scripting and here is what i could come up and it runs without really doing anything. I even tried placing echo... (2 Replies)
Discussion started by: jusblues
2 Replies
6. Shell Programming and Scripting
Hi,
I have a ksh script running on AIX 5.3 which has sometimes a bizarre behaviour.
The script runs a child script like follow.
trap 'rm -f /tmp/res.log;exit 0' 2 15
run_child.sh > /tmp/res.log 2>&1
echo "run_child.sh is terminated"
next instructions...
rm -f /tmp/res.log
... (12 Replies)
Discussion started by: rivalgro
12 Replies
7. Shell Programming and Scripting
Hi,
I'm trying to write a for loop to run through a list of servers and for each server copy a file to a backup file. But I can't seem to get it to run through my server list. It work for individual servers, please see below.
#!/bin/ksh
SSH_USERID=khcuser
webservers="server1 server2"
... (2 Replies)
Discussion started by: elmesy
2 Replies
8. Shell Programming and Scripting
Hello
I am trying to send an email when a .KSH script is run on an AIX Machine.
This email will only include a subject line that is made up of variables from within the script, and is as follows:
CURRENT_DATE=`date +%Y%m%d`
TIME=`date`
ADMIN="myname@domain.com"
date
block ()
{
... (4 Replies)
Discussion started by: jimbojames
4 Replies
9. Shell Programming and Scripting
Hi all,
How can I do a ksh script to watch a log file for 2 specific alarms that have one this string : "Connection Error" and the other one: "Failure in sending". I would like to watch for these two alarms in the log and then if each of them repeats for about 30 times to go kill 2 processes.
... (1 Reply)
Discussion started by: Pouchie1
1 Replies
10. Shell Programming and Scripting
I would like to know if there is a script out there that someone may have already written that I can use to analyze folders and sub folders on my AIX system.
It can be in perl or a basic korn script.
Thanks in advance. (7 Replies)
Discussion started by: seacros
7 Replies
rdeliver(1) General Commands Manual rdeliver(1)
NAME
rdeliver - Ruby mail filter script
SYNOPSYS
rdeliver <options> [script]
DESCRIPTION
This script serves as an example of how you can use the RFilter::DeliveryAgent class to perform mail delivery. You can also use this
script as a fully functioning mail filter.
This script is a basic mail local delivery agent (DeliveryAgent) that can be used in place of procmail, maildrop, etc. in a user's .forward
or .qmail file. The user supplies a delivery script that is written in Ruby, which avoids the limitations of the crippled mini-languages
so often used in other DeliveryAgent programs.
USAGE
rdeliver is invoked from the command line using:
% rdeliver <options> [script]
The script argument is optional. If omitted the script will look for a file called .rdeliver in the home directory.
Options are:
--load-path directory
Prepend the given directory to ruby's load path.
--log filename
Log to the given filename. If no log is specified, no logging occurs.
--home directory
Specify the home directory. rdeliver will change to this directory before reading and writing any files. The home directory
defaults to the value of the HOME or LOGDIR environment variable.
DELIVERY SCRIPT
The delivery script runs in the context of a class called Deliver (in contrast, most ruby scripts run in the context of the Object class).
So any methods added with def will be added to the Deliver class.
A minimal delivery script would be:
def main
agent.save('inbox')
end
This code defines a Deliver#main method that saves the mail into an mbox style mailbox.
The only API the Deliver script has is the #agent method. This retrieves the RFilter::DeliveryAgent object associated with the current
message. Using the API of the RFilter::DeliveryAgent object, you can access and modify the message body and headers, defer or reject the
message delivery, and deliver into various mailbox formats.
See also RFilter::DeliveryAgent and Deliver.
INSTALLATION
Assuming you have the RubyMail mail classes installed, you typically have to put something like this in your .forward file:
|"/usr/bin/rdeliver --log /home/you/.rlog"
This will call rdeliver for each new message you get, and log to /home/you/.rlog.
CATASTROPHIC ERRORS
The rdeliver script is very careful with errors. If there is any problem, it logs the error to the log file you specify. But if you do
not specify a log file, or the error occurs before the log file is opened, a record of the error is placed in a file called CATASTROPH-
IC_DELIVERY_FAILURE in the home directory. If that fails, the error information is printed to the standard output in the hopes that it
will be part of a bounce message. In all cases, the exit code 75 is returned, which tells the MTA to re-try the delivery again.
AUTHOR
rdeliver and RFilter support classes were written by Matt Armstrong <matt@lickey.com>.
This document was originally an RD format document of rdeliver script. This manual page was converted from it for Debian GNU/Linux system.
September 2003 rdeliver(1)