[SOLVED] A script not running since 2nd October 2011
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.
The first thing to check in this case is your cron logs.
The second thing to check, as always, is whether the "problem" is
w/ your data, in this case the logs. Do they actually contain
any lines that match your varied greps since October 2nd?
On a side note: why you define variables a through h, all
w/ the same content, is beyond me ;}
What is the idea with running more from non-interactive session ?
I mean more expects to run in a terminal, no ? With scrolling functions, meaning user action.
To check out whether cedriks's idea is correct, change the "more"s to '"cat" (assuming redirection is happening in the shell script) as you say
Quote:
And the above mentioned script's output is directed in script.sh file.
What could have happened is that before 2nd October, the outputs were less than one screen full and so there was no problemt.
By the way, 2nd October is the birth anniversary of Mahatma Gandhiji and a public holiday.
You can also check the process status logs. Are the previous day's jobs still running? This would happen if it were waiting for a user response ("more" command).
Also as tink says, why are you assigning the output of "date +"%b %_d" to 8 variables (a .. h)? Further as he says, you can check whether after 2nd Oct (Gandhi Jayanthi, public holiday) do the logs contain anything?
All those almost-identical lines...looks like a good place to put a function or two to me.
Also, when you find yourself using a chain of multiple greps, it's probably time to switch to sed or awk instead. We'd probably have to see an example of the input text to come up with a proper solution though.
And hard-coding filenames only means you have to edit the script itself if anything changes. It would be more convenient to at least set them up in variables at the top of the script, or feed them to it as arguments, or even store them in a separate "config" file and source that, rather than using them directly.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.