CentOS 5 :: Get Rid Of Awstats Cron Output
May 27, 2009I' running awstats via
/etc/logrotate.d/httpd
prerotate
/usr/bin/awstats_updateall.pl -awstatsprog=/var/www/awstats/awstats.pl now
endscript
I' running awstats via
/etc/logrotate.d/httpd
prerotate
/usr/bin/awstats_updateall.pl -awstatsprog=/var/www/awstats/awstats.pl now
endscript
I have added some executable scripts to /etc/cron.daily but don't get the stdout/stderr output from them as mail (or anywhere else I have found). At least one of them is running (because I can see that it has added a file to the disk).
The peculiar thing is that I do get the output from /etc/cron.daily/0logwatch (part of the logwatch package) as an email each day.
The MAILTO line in /etc/crontab is "MAILTO=root" (unchanged from default). Same for /etc/anacrontab.
I do have an alias at the end of /etc/aliases which redirects root's mail to my own account, but this alias works fine for mail I send manually. (It also appears to work fine for the output from the file /etc/cron.daily/0logwatch.)
Because I had some difficulties to make awstats running (I'm not an expert!), I would share my experience with a MINI STEP BY STEP GUIDE. I would like also to discuss some details with experts thus at the end of the guide ,I'll make some questions to them:
I have installed a new server Centos 5.5 32 bit and configured 3 virtual hosts; at the end of /etc/httpd/conf/http.conf I have:
-------http.conf virtual host--------
ServerName 127.0.0.1
NameVirtualHost *:80
<VirtualHost *:80>
[code]....
I have a strange issue. The only time I have trouble with yum is when awstats is included in an update. When it is, it always hangs on it when it gets to it. Yum will not complete. I have to cancel out... kill the yum pid and do it again. Tonight I did a yum-complete-transaction to do some unfinished actions - one included the removal of an old awstats - it hung on that.
View 9 Replies View RelatedI have set up a cron in /var/spool/cron/root
*/15 * * * * /usr/bin/phplist.sh
I can see in /var/log/cron that it is running every 15 minutes but it has no effect. It is not doing the commands in the bash script.
If I run /usr/bin/phplist.sh right in the shell it works great.
I have the following shell:
export PATH=/u01/app/oracle/product/10.2.0/db_2/bin:/usr/sbin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin
ftp -u -v -n -i > /bk01/exports/FTP_OUTPUT.LOG <<EOF
open 197.0.0.78
user orabackup orabackup
cd /media/disco/BK_Oracle
bin
put FILE00001.LOG
put FILE00001.DMP
quit
EOF
Executing the shell from command line, the output is:
Connected to 197.0.0.78.
220 Bienvenido al servicio FTP del servidor backup.
530 Please login with USER and PASS.
530 Please login with USER and PASS.
331 Please specify the password.
230 Login successful.
250 Directory successfully changed.
200 Switching to Binary mode.
local: EXPO_APOT10G_20100531.LOG remote: EXPO_APOT10G_20100531.LOG 227 Entering Passive Mode (197,0,0,78,200,162) 150 Ok to send data. 226 File receive OK. 127498 bytes sent in 0.0022 seconds (5.7e+04 Kbytes/s)
local: EXPO_APOT10G_20100531.DMP remote: EXPO_APOT10G_20100531.DMP
227 Entering Passive Mode (197,0,0,78,175,141) 150 Ok to send data. 226 File receive OK. 458190848 bytes sent in 6.1 seconds (7.3e+04 Kbytes/s)
221 Goodbye.
Executing the shell from cron, the output is:
Connected to 197.0.0.78 (197.0.0.7.
220 Bienvenido al servicio FTP del servidor backup.
331 Please specify the password.
230 Login successful.
250 Directory successfully changed.
200 Switching to Binary mode.
local: EXPO_APOT10G_20100531.LOG remote: EXPO_APOT10G_20100531.LOG
local: EXPO_APOT10G_20100531.DMP remote: EXPO_APOT10G_20100531.DMP
221 Goodbye.
Why from cron the output no show the statistics in red ...?
has no MTA (Postfix, Sendmail, Exim) installed so it can't email me the results of any cron job I schedule. I would then like to have the results from Cron be dumped into a small text file so I can read it later to view any issues.Right now my job is as follows:Code:01 18 * * * /usr/bin/shellscript.shAbove you see my script I want to run every day @ 6:01 pm. My question is what would the cron line look like if I wanted the results dumped into a random text file somewhere on my system?
View 1 Replies View RelatedI am trying to display a text using crontab. My settings :
*/2 * * * * /bin/echo "hello"
This setting sends a mail to the user, instead of displaying on the screen. Now tried changing the setting to:
*/2 * * * * /bin/echo "hello" > /dev/tty1
Now I can see the text on the screen, but this setting comes with a catch. What would happen if the user changes the terminal. for instance if he gets into tty2, he wont have write access on tty1. So the user gets a mail saying "permission denied". Is there any way that I can force the user to use a particular terminal or can a cron job be set in a way such that the user would get the text irrespective of the terminal he logs in.
i got a bash script which can remind me my friends' birthday ,and i want run it as a cron job everyday,but the linux just emails me the output.Now my question is how to how to redirect the cron output to screen.
PS: when i run the script mannually ,it runs very well,so my script is good. And i have tried :
1.30 8 * * * root /home/birth.sh >/dev/console
it shows nothing
2. 30 8 * * * root /home/birth.sh >/dev/tty1
the same as 1
3. 30 8 * * * root /home/birth.sh >/dev/tty
it shows:/bin/sh: cannot create /dev/tty: No such device or address
why sadc (a front end for sar data collection) would append a "?" to the output file when run from cron? And more particularly, how should I correct it? I have a RHEL 5.4 system which is doing this.e.g./usr/lib64/sa/sadc -d 10 6 /tmp/test produces output file /tmp/test when run from the command line but when run from cron the file produced is called "/tmp/test?"
Normal system logging with sysstat, which uses the same sadc command (with a couple of other options, and none of the options -d, -F, -L affect this behaviour), produces output files /var/log/sa/sadd where "dd" is the day of the month. There does not seem to be any control over this within the sysstat start-up scripts, other than use of option "-" to generate standard output files, so I expect that the dd is being done within the code. Is this associated with the "?" ?.Whatever is going on, the appended query seems to get added to everything as it still happens if I make the output file /tmp/test_$(/bin/date +\%d).Is this a bug or am I missing something fundamental about cron?
I have a test socket on a server. If I connect to it using telnet, I get exactly the response I expect. So I know the socket works, and the script on the server works:
Code:
my-desktop:~$ telnet 192.168.1.1 3333
Trying 192.168.1.1...
Connected to 192.168.1.1.
Escape character is '^]'.
RAM: 90 % Free ( 2793 M free, 3082 M total)
Connection closed by foreign host. And if I script it, I get almost the same response from Telnet, but still a valid response from the socket. So I know that my script works:
[Code].....
Using CentOS. I have a cron setup to run this command: Code: /var/test.sh | mail -s "Test Cron" mr182@somewhere.com The email is sent but the output of the script is not in the email body, it's just blank. I know there is some output because there are some echo statements in the script.I don't want to get an email for all cronjobs, just this one.
View 1 Replies View RelatedI have created a conjob via ssh by going to crontab -e and adding my scripts like 05 10 * * * /scripts/old-files-delete.sh.The file has 755 permissions and if I run the script manualy it works fine. I have checked the cron log and it does not show up as running at all.
View 5 Replies View RelatedI want to create some scheduled jobs in a CentOS server. These jobs are simple and repeatable, but the scheduling is complicated. I want a series of jobs to start every day but Monday, and not on the last day of the month. These jobs depend on software execution outside the server ( a Windows application) so if the Windows app fails, I need to temporarily suspend the cron jobs so I can straighten out the Windows server.
I've looked over some cron alternatives and nothing seems suitable. Am I stuck with cron and the limitations of crontab, or are there some programmatic things I can do in cron that I don't know about?
I'm having a very strange issue with cron on centos 5.3 64-bit. I have 3 cron scripts in /etc/cron.daily which run backups. They are as follows:
script1:
#!/bin/bash
/usr/local/bin/backup-script1
script2:
#!/bin/bash
/usr/local/bin/backup-script2
script3:
#!/bin/bash
/usr/local/bin/backup-script3
The contents of the 3 /usr/local/bin scripts are ...
/usr/local/bin/backup-script1:
#!/bin/bash
synbak -s srv1 -m rsync
rsync -av --delete /data/backup/srv1/* root@::share/srv1/
To explain this, the 1st active line does a synbak backup and the 2nd active line rsyncs the backup data to a remote server.
/usr/local/bin/backup-script2:
#!/bin/bash
synbak -s srv2 -m rsync
rsync -av --delete /data/backup/srv2/* root@::share/srv2/
[code]....
I'm trying to add several cron jobs. I have a folder (/etc/cron.myapp) with several subfolders in it (30minute, 3minute, daily, hourly). Each of these folders contains a script.Runnng/usr/bin/run-parts /etc/cron.myapp/3minute/will execute the contents of that folder.I have tried adding the following entries to /etc/crontab with no luck, and nothing is showing up in /var/log/cron
*/3 * * * * /usr/bin/run-parts /etc/cron.myapp/3minute/
*/3 * * * * /usr/bin/run-parts /etc/cron.myapp/3minute
*/3 * * * * root /usr/bin/run-parts /etc/cron.myapp/3minute/
[code]....
I am using cent os 5. I My server daily shutdown at 7:00 PM.I want to see the log file of my cron activity what the process is successfully started or not
View 1 Replies View Relatedi cannot find it in the man. Is it possible to run cron job like this:
Run script from 18 00 till 5 00?
I want to run some script but only during the night time, when users are not working.
I have an script called conection located in /etc/ppp ( /etc/ppp/conection)The content of the scrips is:
pppd call isp Running it by hand, it dials out to my ISP and fetch all my email from different accounts and turn-off the link. It works great. I decided to automate the process using the cron.
The problem is when cron execute it at the specified time, nothing happens. It doesn't even dials out. I checked /var/log/cron and cron says It was executed. But it doesn't. I try again running the script by hand and works fine.
I have the following cron configuration in the 'crontab' file:
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=<--- REMOVED -->
HOME=/
# run-parts
01 * * * * root run-parts /etc/cron.hourly
02 4 * * * root run-parts /etc/cron.daily
22 4 * * 0 root run-parts /etc/cron.weekly
42 4 1 * * root run-parts /etc/cron.monthly
20 16 * * 1-5 root wget [URL]
07 30 * * 1-5 root wget [URL]
11 30 * * 1-5 root wget [URL]
My focus is on the three WGET commands. The problem is the first one works fine, runs at 4:20 p.m., but the other two never run! If I visit [URL] it works fine but cron never runs it.
I made a big rookie mistake in a script in cron.daily, which emptied the directory when I tested it... now I'm left with an empty cron.daily directory, and from what I know there definitely were more scripts there than only my own. Does anybody know what scripts CentOS 5.4 (Final) needs in the cron.daily?
View 3 Replies View RelatedI was wondering how I can get this done. I reinstalled my awstats and deleted my awstats data. How do I pull the data from my original access_log which is around 270MB in size.
Any suggestion? I tried updating awstats but it's timing out and I'm getting an internal server error which I assume is from the 270MB access_log size.
I just installed awstats and I can't get it to generate any report? I used the default Fedora 12 install.Here is the config file:
Code:
LogFile="/var/log/httpd/access_log"
LogType=W
LogFormat=1
LogSeparator=" "
SiteDomain="dev-server.net"
[Code]...
Within a VMWare ESX virtual machine, I am running CentOS 5.2. (Actually, it is kind of a virtual appliance to run CollabNet's Teamforge - which I have installed for a trial). I've been dabling with Linux for a year or so, but I know I have much to learn.
I'm attempting to run a cron job that runs a backup script at 11pm. It works great, but unfortunately it runs at 11:30 am.
I created the cron job using 'crontab -e', while logged in as root. My cron job line is : 0 23 * * 1,2,3,4,5 /etc/tjt_backup/collabnet_backup.sh
If I type 'date', I get the correct date/time in my timezone: Tue Mar 9 16:27:12 CST 2010
If I type 'clock', I also get the correct date/time: Tue 09 Mar 2010 04:26:57 PM CST -0.463330 seconds
(Although, it appears there is a little drift)
I have a server im trying to use with clamAV to scan it all and with cron job. it worked fine for few days, sending me emails with reports, i was happy. now i get ERR emails and when running manually i get the follwing message output: Script: clamav-cron v. 0.6 - Copyright 2009, Stefano Stagnaro Scanned: /
[Code]...
How can I remove awstats from my Debian Lenny installation, will aptitude remove awstats
View 5 Replies View RelatedI'm trying to set up awstats for my web server which runs ISPConfig3. Due to ISPConfig, my log-rotated files have the extension .log.gz, and the naming syntax of DATE-access.log.gz.
According to awstats documentation, I need their tool to merge the log files, however, I cannot get it to work. I always get file not found or pipe error like messages.
Code:
I took a look at permissions, log files are world-readable. Checked path's 1000 times, no typo. When I try to find out whats wrong, the problems usually begins when I try to use the * character in the LogFile variable, ..
Anyone got experience with multiple log files and awstats? ...
We had recently got some problem with our server(local server) and we recently upgraded from Ubuntu server 8.04 to 10.04 and we were not able to access awstats logs from web.So can any one say a method to get back the logs from the server?
View 1 Replies View RelatedHow to install and configure awstats in ubuntu?
View 1 Replies View RelatedI'm trying to install awstats via the command line
after running
Code:
apt-get install awstats
, seems to install OK
when running the command
Code:
cp /etc/awstats/awstats.conf /etc/awstats/awstats.yourdomain.ext.conf
I get NO such directory or file any idea to why
I'm logged in as root system is Ubuntu 9.04 l TT ( karl )