ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
yesterday whole night I tried this above script running manually. It was taking long enough to generate a weekly report. The script took around 5 hrs and keeps on running even then and never ended with a result.. What could be the problem?
These things apply to ALL problems, not just shell scripts. Walk through things one step at a time, and figure out what's wrong. Again, you have been given the solution several times. Also, have you bothered to read the sarg man page? Perhaps look at the "-o" option, that TELLS SARG WHERE TO WRITE THE REPORT, which you haven't done yet.
Quote:
Originally Posted by Cedrik
Sorry, but can you understand this:
कार्यक्रम एक फाइल में उत्पादन का उत्पादन
Nice one, Cedrik.
Click here to see the post LQ members have rated as the most helpful post in this thread.
For some reason, this conversation is starting to remind me of the first episode of Red Dwarf.
Quote:
Originally Posted by Satyaveer Arya
I can understand this, but what exactly you want to say?
It's redirected to a file, Dave. Stdout is redirected to a file. Stderr is redirected to a file. All output is redirected to a file. Everything is redirected to a file, Dave.
(Sorry, couldn't resist)
Distribution: RHEL, CentOS, Debian, Oracle Solaris 10
Posts: 1,420
Original Poster
Rep:
Hi TBOne,
Today I tried this script to generate weekly report:
Quote:
#!/bin/bash
LOG_FILES=
if [ -s /var/log/squid/access.log.2.gz ]; then
LOG_FILES="-l /var/log/squid/access.log.2.gz"
fi
if [ -s /var/log/squid/access.log.1.gz ]; then
LOG_FILES="-l /var/log/squid/access.log.1.gz"
fi
if [ -s /var/log/squid/access.log ]; then
LOG_FILES="-l /var/log/squid/access.log"
fi
# Get yesterday's date
YESTERDAY=$(date --date "1 days ago" +%d/%m/%Y)
# Get one week ago date
WEEKAGO=$(date --date "7 days ago" +%d/%m/%Y)
This may be a bug in sarg. Are you using the latest version? It could also be caused by something being wrong with the input data, but in any case crashing as a way of informing the user of invalid input is generally not considered a good programming practice.
How large is your log file? If I were you, I would also look at the sarg.conf file and try to play with the settings a bit.
Hi millgates,
The version of sarg I'm using is sarg-2.2.3.1 Jan-02-2007.
So you're using five year old software? The latest version is 2.3.1, and if you read the changelogs on the sarg site, you'd see that it's been patched numerous times, to address crashing. Run the latest version.
Quote:
If you're asing about access.log then it keeps on rotating, so size of log file keeps on varying. And here I'm attaching my sarg.conf file. Please look into the configuration file, the changes I have made if it is correct...
The sarg config isn't getting read, since the program is crashing, so there's not much to look at there. Update your software.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.