LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-05-2012, 09:53 PM   #1
SuryaDipa
LQ Newbie
 
Registered: Jan 2012
Location: Indonesia
Distribution: Ubuntu
Posts: 5

Rep: Reputation: Disabled
Wink [Ask]lightparser.pl can't run aotomatic [lighsquid)?


I've successfully installed lightsquid, to get the report to the apache2 we should to run the script :
Code:
perl lightparser.pl /var/log/squid/access.log
on terminal in folder /var/www/lightsquid/
see tutorials on google, to run lightparser.pl automatic is include the script into the crontab-e :
Code:
*/50 * * * * /var/www/lightsquid/lihgtparser.pl today
50 means that if we want to run automatically after 50 minutes lightparser.pl.
The problem is lightparser.pl does't run automatically?
Can you help me? I'am a new member and this post is the first-time posting!
 
Old 01-06-2012, 11:33 AM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 17,916

Rep: Reputation: 3689Reputation: 3689Reputation: 3689Reputation: 3689Reputation: 3689Reputation: 3689Reputation: 3689Reputation: 3689Reputation: 3689Reputation: 3689Reputation: 3689
Quote:
Originally Posted by SuryaDipa View Post
I've successfully installed lightsquid, to get the report to the apache2 we should to run the script :
Code:
perl lightparser.pl /var/log/squid/access.log
on terminal in folder /var/www/lightsquid/ see tutorials on google, to run lightparser.pl automatic is include the script into the crontab-e :
Code:
*/50 * * * * /var/www/lightsquid/lihgtparser.pl today
50 means that if we want to run automatically after 50 minutes lightparser.pl. The problem is lightparser.pl does't run automatically? Can you help me? I'am a new member and this post is the first-time posting!
What do the log files say?? You don't tell us what version/distro of Linux, but normally you can look in /var/log, and see if there are cron logs in there somewhere.

First thing to check is if the path of lightparser.pl is correct. Is that really where you installed it? Is it executable? (do an "ls -l" on that file, and make sure the "x" is present). Also, lightparser.pl is misspelled in what you posted...typo there, or on your system???
 
1 members found this post helpful.
Old 01-06-2012, 10:30 PM   #3
SuryaDipa
LQ Newbie
 
Registered: Jan 2012
Location: Indonesia
Distribution: Ubuntu
Posts: 5

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by TB0ne View Post
What do the log files say?? You don't tell us what version/distro of Linux, but normally you can look in /var/log, and see if there are cron logs in there somewhere.

First thing to check is if the path of lightparser.pl is correct. Is that really where you installed it? Is it executable? (do an "ls -l" on that file, and make sure the "x" is present). Also, lightparser.pl is misspelled in what you posted...typo there, or on your system???
I use ubuntu 11:04 Natty Narwhal, in the directory /var/log. cron logs does't exist..
and permission of lightparser.pl file is - rwx r-x r-x.
And no problems if runing on terminal perl lightparser.pl /var/log/squid/access.log..
whether there is error writing in cron?
 
Old 01-07-2012, 11:42 AM   #4
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 17,916

Rep: Reputation: 3689Reputation: 3689Reputation: 3689Reputation: 3689Reputation: 3689Reputation: 3689Reputation: 3689Reputation: 3689Reputation: 3689Reputation: 3689Reputation: 3689
Quote:
Originally Posted by SuryaDipa View Post
I use ubuntu 11:04 Natty Narwhal, in the directory /var/log. cron logs does't exist..
and permission of lightparser.pl file is - rwx r-x r-x.
And no problems if runing on terminal perl lightparser.pl /var/log/squid/access.log..
whether there is error writing in cron?
Ok, again...you misspelled it on your post here. I asked whether that was a posting error, or if it was the same in your CRON file, but you didn't answer.

Also, HOW are you editing the crontab file? Via "crontab -e", or are you just manually editing the file? Is that file running in the root crontab, or a 'regular' user? Do you have ANY other cron jobs that ARE running?? Is the cron daemon running (can usually check with "/etc/init.d/cron status")? If cron is running, put ANY other job in there, even if it's a small shell script to move/copy a file. Jobs should be logged. You can also put a "> /var/log/lighparser.log" at the end of your job, to see what happens.
 
1 members found this post helpful.
Old 01-08-2012, 09:21 PM   #5
SuryaDipa
LQ Newbie
 
Registered: Jan 2012
Location: Indonesia
Distribution: Ubuntu
Posts: 5

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by TB0ne View Post
Ok, again...you misspelled it on your post here. I asked whether that was a posting error, or if it was the same in your CRON file, but you didn't answer.

Also, HOW are you editing the crontab file? Via "crontab -e", or are you just manually editing the file? Is that file running in the root crontab, or a 'regular' user? Do you have ANY other cron jobs that ARE running?? Is the cron daemon running (can usually check with "/etc/init.d/cron status")? If cron is running, put ANY other job in there, even if it's a small shell script to move/copy a file. Jobs should be logged. You can also put a "> /var/log/lighparser.log" at the end of your job, to see what happens.
ok, I'm sorry
It is true, it was the same in my CRON file.
I edit the contab file via crontab -e, file running in reguar user.
I do not know if there are other jobs running.
after I check the status of cron, it appears :
Code:
Rather than invoking init scripts through /etc/init.d, use the service(8)
utility, e.g. service cron status

Since the script you are attempting to invoke has been converted to an
Upstart job, you may also use the status(8) utility, e.g. status cron
cron start/running, process 704
I have put a "> /var/log/lighparser.log" at the end of my cron job, and can't install cron, it appears :
Code:
"/tmp/crontab.q0ONfQ/crontab":23: bad minute
errors in crontab file, can't install.
..
sorry if my writing is many misspelled, I can't english well.
 
Old 01-08-2012, 09:47 PM   #6
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 17,916

Rep: Reputation: 3689Reputation: 3689Reputation: 3689Reputation: 3689Reputation: 3689Reputation: 3689Reputation: 3689Reputation: 3689Reputation: 3689Reputation: 3689Reputation: 3689
Quote:
Originally Posted by SuryaDipa View Post
ok, I'm sorry
It is true, it was the same in my CRON file. I edit the contab file via crontab -e, file running in reguar user. I do not know if there are other jobs running. after I check the status of cron, it appears :
Code:
Rather than invoking init scripts through /etc/init.d, use the service(8)utility, e.g. service cron status

Since the script you are attempting to invoke has been converted to an Upstart job, you may also use the status(8) utility, e.g. status cron cron start/running, process 704
I have put a "> /var/log/lighparser.log" at the end of my cron job, and can't install cron, it appears :
Code:
"/tmp/crontab.q0ONfQ/crontab":23: bad minute
errors in crontab file, can't install.
..
sorry if my writing is many misspelled, I can't english well.
Ok...since you clarified that the line you posted was also misspelled, did you also post the rest of the line accurately? The log message tells you what's wrong. The format for the minute is incorrect.

If you want it to run every hour, on the 50th minute, it would be just
Code:
50 * * * * /var/www/lightsquid/lightparser.pl today
Look up the examples for crontab usage, which are plentiful:
http://www.pantz.org/software/cron/croninfo.html
 
1 members found this post helpful.
Old 01-08-2012, 10:39 PM   #7
SuryaDipa
LQ Newbie
 
Registered: Jan 2012
Location: Indonesia
Distribution: Ubuntu
Posts: 5

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by TB0ne View Post
Ok...since you clarified that the line you posted was also misspelled, did you also post the rest of the line accurately? The log message tells you what's wrong. The format for the minute is incorrect.

If you want it to run every hour, on the 50th minute, it would be just
Code:
50 * * * * /var/www/lightsquid/lightparser.pl today
Look up the examples for crontab usage, which are plentiful:
http://www.pantz.org/software/cron/croninfo.html
Oo.. the line "> /var/log/lighparser.log" is for debuging
After I change line "*/50 * * * * /var/www/lightsquid/lihgtparser.pl today" to "50 * * * * /var/www/lightsquid/lightparser.pl today"
But the same error appears that line 23 is Bad Minute,
Thanks for the reference, I will visit those web.
 
Old 01-08-2012, 11:07 PM   #8
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 17,916

Rep: Reputation: 3689Reputation: 3689Reputation: 3689Reputation: 3689Reputation: 3689Reputation: 3689Reputation: 3689Reputation: 3689Reputation: 3689Reputation: 3689Reputation: 3689
Quote:
Originally Posted by SuryaDipa View Post
Oo.. the line "> /var/log/lighparser.log" is for debuging
Right.
Quote:
After I change line "*/50 * * * * /var/www/lightsquid/lihgtparser.pl today" to "50 * * * * /var/www/lightsquid/lightparser.pl today"
But the same error appears that line 23 is Bad Minute,
Thanks for the reference, I will visit those web.
Check the script and the config file...are there references in it to time?
 
1 members found this post helpful.
Old 01-08-2012, 11:37 PM   #9
SuryaDipa
LQ Newbie
 
Registered: Jan 2012
Location: Indonesia
Distribution: Ubuntu
Posts: 5

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by TB0ne View Post
Right.

Check the script and the config file...are there references in it to time?
I haven't read all.
where the location of the file crontab -e that I've edited in terminal?
I see the crontab file in /etc is not same!
 
Old 01-09-2012, 12:46 AM   #10
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,240

Rep: Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324
crontab -e edits the crontab file that belongs to the current user. This is NOT the same as the system crontabs in /etc.

Decide which you want to edit and start by using the 'cat' dmd to check the content, then take a copy, then edit it.

http://www.adminschoice.com/crontab-quick-reference

Last edited by chrism01; 01-09-2012 at 12:47 AM.
 
2 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to run linux command from a different user from a jsp page which is run by tomcat etika Linux - Newbie 2 04-27-2011 12:53 PM
My BASH script work perfect when i run it manualy, but not when it run in the crontab roqarg Linux - Newbie 30 05-06-2010 02:37 PM
How to enter graphical mode (run level 5) command line (run lenel 3) edmondgyampoh Linux - Newbie 3 05-15-2009 07:33 PM
trying to fix xwindows or just run command line... changing run levels dave247 Debian 2 11-18-2008 07:11 PM
I run Fedora 9 and I boot from USB, how I run at startup Firewall and antivirus? gginis Linux - Software 3 06-08-2008 04:19 AM


All times are GMT -5. The time now is 06:39 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration