06-28-2005
I thought I read that cron needs to be able to see the path to the script or parameteres within the script. Is this set in /etc/default/cron.
Below is a copy of the script, (message_log.pl).
# more message_log.pl
#!/usr/local/bin/perl
#! /usr/bin/ksh
#MagicStore message log utility
( $sec, $min, $hour, $mday, $mon, $year,, ) = localtime();
$today = sprintf( "%04d%02d%02d", ( $year + 1900 ), ( $mon + 1 ), $mday );
print "Parsing through message log...........\n";
sleep 2;
system("mkdir log") if (! -d "./log");
InstallScript();
system("./dl.csh > /images_1/messages/dl.out");
system("./dl.awk /images_1/messages/dl.out > /images_1/messages/dl1.out");
#---------------Set the line below to what type of message you want to trap-----
---------
system("grep PAT_INCONSISTENT /images_1/messages/dl1.out>$today.message.log");
system("rm -f /images_1/messages/dl.out");
system("rm -f /images_1/messages/dl1.out");
print "Your file named $today.message.log is ready for viewing\n";
sub InstallScript
{
unlink("/images_1/messages/dl.csh");
open(CSH,">/images_1/messages/dl.csh");
print CSH "#!/bin/csh\n";
print CSH "source ~work/.cshrc\n";
print CSH "source /home/sn_root/bin/apc/apc_env.csh\n";
print CSH "/home/sn_root/bin/apc/apc << EOF\n";
print CSH "4\n11\n5\n1\nEOF\n";
close(CSH);
system("chmod a+rwx /images_1/messages/dl.csh");
unlink("/images_1/messages/dl.awk");
open(AWK,">/images_1/messages/dl.awk");
print AWK "#!/usr/bin/nawk -f\n";
print AWK 'BEGIN { FS="\n";';
print AWK 'RS = "" }';
print AWK "\n";
print AWK "{\n";
print AWK 'if(sub(/^ date *:/,"",$1)) {';
print AWK "\n";
print AWK 'sub(/^ message *:/,"",$2)';
print AWK "\n";
print AWK 'print $1,$2';
print AWK "\n";
print AWK "\n}\n}";
close(AWK);
system("chmod a+rwx /images_1/messages/dl.awk");
}
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I've got an *extremely* simple script I want to run every minute:
#!/bin/sh
ping -c 1 192.168.1.20 > ~/onlinestatus.txt
So, the script is called "status", it's executable, and in the correct path, etc. In a terminal window (I'm using Mac OS X), I can type status, and it will create... (4 Replies)
Discussion started by: jmf77
4 Replies
2. Shell Programming and Scripting
Hi all,
Does anybody know or guide me on how to remove the first N bytes and the last N bytes from a binary file? Is there any AWK or SED or any command that I can use to achieve this?
Your help is greatly appreciated!!
Best Regards,
Naveen. (1 Reply)
Discussion started by: naveendronavall
1 Replies
3. UNIX for Dummies Questions & Answers
I am attempting to run a cron job, however, I receive this cron output error:
Error: of parameter : xxxxx does not make a valid output file.
What causes this? (4 Replies)
Discussion started by: AM1234
4 Replies
4. Solaris
root@erpdevserver $ vxassist -g devdg maxsize
Maximum volume size: 55207936 (26957Mb)
This is the output in vxvm(3.1).. my question is
how we can calculate this bytes(55207936) in to MB(output=26957) or in GB.plz tell how to calculate (2 Replies)
Discussion started by: tv.praveenkumar
2 Replies
5. Red Hat
I have the following cron task set to run every 15 minutes to ascertain how many users are in the system and append the result to the log.
/home/pronto/cus/whoisinc >> /home/pronto/cus/whoisin.log
This is the whoisinc script
date +"%d-%m-%Y,%k:%M,Pronto Users,`prowho -s | grep -v... (1 Reply)
Discussion started by: scottm
1 Replies
6. Shell Programming and Scripting
While running script I am getting an error like
Few lines in data are not being processed.
After googling it I came to know that adding such line would give some memory to it
ini_set("memory_limit","64M");
my input file size is 1 GB.
Is that memory limit is based on RAM we have on... (1 Reply)
Discussion started by: elamurugu
1 Replies
7. Programming
Hi,
If I want to copy a 1024 byte data stream in to the target location in 3-bytes chunk, I guess I can use the following script.
dd bs=1024 count=3 if=/src of=/dest
But, I would like to know, how to do it via a C program. I have tried this with memcpy(), that did not help. (3 Replies)
Discussion started by: royalibrahim
3 Replies
8. Shell Programming and Scripting
How do I output only the first 400 bytes of a huge text file to a new file.
It has to be unmodified so no added invisible characters.
Many thanks..... (3 Replies)
Discussion started by: garethsays
3 Replies
9. UNIX for Dummies Questions & Answers
Hello guys. I really hope someone will help me with this one..
So, I have to write this script who:
- creates a file home/student/vmdisk of 10 mb
- formats that file to ext3
- mounts that partition to /mnt/partition
- creates a file /mnt/partition/data. In this file, there will... (1 Reply)
Discussion started by: razolo13
1 Replies
10. Shell Programming and Scripting
hello,
suppose, entered input is of 1-40 bytes, i need it to be converted to 40 bytes exactly.
example: if i have entered my name anywhere between 1-40 i want it to be stored with 40 bytes exactly.
enter your name:
donald duck (this is of 11 bytes)
expected is as below - display 11... (3 Replies)
Discussion started by: shravan.300
3 Replies
LEARN ABOUT CENTOS
yum-cron
yum-cron(8) yum-cron(8)
NAME
yum-cron - an interface to convieniently call yum from cron
SYNOPSIS
yum-cron [config-file]
DESCRIPTION
yum-cron is an alternate interface to yum that is optimised to be convenient to call from cron. It provides methods to keep repository
metadata up to date, and to check for, download, and apply updates. Rather than accepting many different command line arguments, the dif-
ferent functions of yum-cron can be accessed through config files.
config-file is used to optionally specify the path to the configuration file to use. If it is not given, the default configuration file
will be used. It is useful to be able to specify different configuration files for different use cases. For example, one configuration
file might be set to update the repository metadata, and a line could be added to the crontab to run yum-cron frequently using this file.
Then, another configuration file might be set to install updates, and yum-cron could be run from cron using this file just once each day.
FILES
/etc/yum/yum-cron.conf
/etc/yum/yum-cron-hourly.conf
SEE ALSO
yum (8)
AUTHORS
See the Authors file included with this program.
BUGS
There of course aren't any bugs, but if you find any, you should email
the mailing list, yum@lists.baseurl.org, or consult bugzilla.
Nick Jacek yum-cron(8)