LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 08-29-2012, 08:39 AM   #1
sueco
LQ Newbie
 
Registered: May 2011
Posts: 4

Rep: Reputation: Disabled
crontab problem


Hi

Background to my problem, is that I have done some program that reads some stuff from the internet and puts it into some database.

Problem:I wanted to run the code every 4th hour (0,4,8,12,16,20) so I started crontab with

Code:
00 0,4,8,12,16,20 * * * java -jar /home/xxxxx/CODE/Database/database.jar
but some weird behavior appears, sometimes it works and sometimes it doesn't. as you can see in the print from the database below

Code:
| 15 |        8 |        16 | 2012-08-26 00:00:10 |
| 16 |       11 |        15 | 2012-08-26 16:00:08 |
| 17 |       10 |        15 | 2012-08-26 20:00:07 |
| 18 |        4 |        17 | 2012-08-27 08:00:04 |
| 19 |       10 |        20 | 2012-08-27 12:00:16 |
| 20 |       13 |        14 | 2012-08-27 16:00:05 |
| 21 |        6 |        14 | 2012-08-28 04:00:04 |
| 22 |        5 |        18 | 2012-08-28 08:00:04 |
| 23 |       10 |        18 | 2012-08-28 12:00:07 |
| 24 |       14 |        16 | 2012-08-28 16:00:11 |
| 25 |       11 |        20 | 2012-08-29 08:00:05 |
+----+----------+-----------+---------------------+
My computer is allways on and connected to the internet. So I don't understand why it works randomly. Have I missed something?
 
Old 08-29-2012, 08:44 AM   #2
lleb
Senior Member
 
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora/Pop!_OS
Posts: 2,983

Rep: Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551
does not look like you are missing anything, but you can check /var/log/cron to see if it is starting as scheduled. if it is, then it is not cron.

just FYI an easier way to set the cron to run every 4hrs would be:
Code:
00      */4    *     *     *    foo
 
Old 08-29-2012, 09:27 AM   #3
sueco
LQ Newbie
 
Registered: May 2011
Posts: 4

Original Poster
Rep: Reputation: Disabled
Hi.

I can't even find anything that got the name of cron in "/var/log/"
Can it be somewhere else?
 
Old 08-29-2012, 10:38 AM   #4
earthnet
Member
 
Registered: Jul 2012
Distribution: OpenSUSE
Posts: 36

Rep: Reputation: Disabled
On my system cron logs to /var/log/messages.
 
Old 08-29-2012, 11:34 AM   #5
lleb
Senior Member
 
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora/Pop!_OS
Posts: 2,983

Rep: Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551
try here maybe this will help with ubuntu logs for cron:

http://askubuntu.com/questions/56683...on-crontab-log

good luck.
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with Crontab sam4classic Linux - Server 9 05-21-2010 01:12 PM
crontab problem almon Linux - Newbie 1 10-11-2007 02:27 PM
Crontab Problem dieduster Linux - Software 1 11-16-2006 05:49 AM
crontab problem sunnyanthony Linux - Software 1 01-07-2006 04:48 AM
crontab problem provo1234 Linux - General 3 01-21-2005 11:20 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 07:10 AM.

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
Open Source Consulting | Domain Registration