LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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 03-15-2004, 03:00 PM   #1
melk600
LQ Newbie
 
Registered: Nov 2003
Location: Ashland, OH
Distribution: Mandriva
Posts: 16

Rep: Reputation: 1
Unhappy Cron job stopping before it finishes


I set up a simple cron job that runs the syncronization program Unison.

My problem is that it doesn't work unless it can run very quickly. If I change just one file it will run just fine, but if it has to syncronize say 20 or more files, it doesn't syncronize any of them. The only thing different between these 2 jobs that I can see being different is the time they take to run. Running the same command from the shell, the 1 file syncronization takes about 15 seconds to run, and the 20 file sync takes around 40 seconds (changes slightly depending on file size of course). So, does cron have some sort of timeout feature that is stopping it, or something else altogether different.

Any help would be much appreciated.

P.S. running Fedora Core 1 on an i386 platform
 
Old 03-25-2004, 07:47 AM   #2
oobayly
LQ Newbie
 
Registered: Mar 2004
Posts: 4

Rep: Reputation: 0
Same Problem

I'm running Mandrake 10.0 Community on an i586 and have a similar problme. I've got a script which backs up a remote DB and tars & gzips files from local Samba shares. It can take up to 20min to run
If I run it in a shell or through webadmin (execute cron job immediately) it runs fine, but when it is executes as a scheduled job it stops after backing up the DB. I'm thinking it's a similar problem to yours.
Have you found a solution, or a way in altering the cron job's timeout
 
Old 03-25-2004, 08:05 AM   #3
dominant
Member
 
Registered: Jan 2004
Posts: 409

Rep: Reputation: 30
Is there any error message for the unfinished cron job?
 
Old 03-25-2004, 08:47 AM   #4
oobayly
LQ Newbie
 
Registered: Mar 2004
Posts: 4

Rep: Reputation: 0
Nope, both the cron error & warning logs are empty, the info log just reports that the job was started.
Is there a timeout option for cron jobs?
 
Old 03-25-2004, 09:07 AM   #5
melk600
LQ Newbie
 
Registered: Nov 2003
Location: Ashland, OH
Distribution: Mandriva
Posts: 16

Original Poster
Rep: Reputation: 1
Lightbulb

I found an easy solution to both of our problems, not a fix (still can't figure out what is causing it, no errors same as you, just job started in the log). Anyhow, the way I fixed it was to download fcron. It is similar to cron only it actually has more options for scheduling times. And best of all it works.

You can get it from http://fcron.free.fr/
 
Old 03-25-2004, 09:22 AM   #6
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,629

Rep: Reputation: Disabled
There is also anacron.

Last edited by JZL240I-U; 04-23-2007 at 01:50 AM.
 
Old 04-22-2007, 08:32 PM   #7
Koppie
Member
 
Registered: May 2006
Location: San Francisco, CA
Distribution: Kubuntu Feisty Fawn
Posts: 41

Rep: Reputation: 15
I've got a similar problem. I want my wife's computer to back up to the server once a day. I've set up unison and it works fine when I do a manual run. I can use the preferences file or just do it all from the command line:
Code:
/usr/bin/unison -batch /media/sda4/ "ssh://192.168.1.3//media/hdc1/Lena Backup/"
It works either way. I've even created a small script:
Code:
#!/bin/sh
echo "Began run" >> /home/sweetie/unison.log
date >> /home/sweetie/unison.log
/usr/bin/unison -batch /media/sda4/ "ssh://192.168.1.3//media/hdc1/Lena Backup/"
echo "Ended run" >> /home/sweetie/unison.log
date >> /home/sweetie/unison.log
This way I can watch unison.log and even if unison doesn't work, it'll still give me the date & time so I know the script ran.

I've also successfully set up a cron job to run the script, and I get output in unison.log so I know the script ran.

I even added the SSH keys so it won't ask for a password.

Here's the problem: unison won't run as part of a cron job. If I run the script, it will still put the date & time in unison.log, but unison itself won't run.

I've tried everything I could think of:
- run unison with a prefs file in crontab
- run unison with a straight command line in crontab
- run my script in crontab
- tried all these things in both the user's crontab as well as /etc/crontab

Doesn't work!!! She's running Kubuntu Feisty Fawn (brand new stable version). Cron, Anacron, Unison, and SSH are all running.

What on earth is going wrong? What did I miss? How do I fix it? I saw the suggestion to run fcron, but frankly I've got two cron programs running already. I'd rather learn how to use them properly. Any ideas???

Thanks in advance!!!
 
Old 04-23-2007, 01:53 AM   #8
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,629

Rep: Reputation: Disabled
I use fcron by now. It has very many options and is predestined for workstations which are not running round the clock. And the author suggests that fcron will replace cron in time ...

So you could use it while still trying to find out about cron -- I can't help you there, sorry.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to schedule an "at" job to start when another finishes? ashlock Programming 10 01-13-2005 11:12 PM
Cron job rajasekarvr Linux - General 4 05-03-2004 05:35 PM
cron job ? johnyy Linux - Software 3 12-10-2003 06:00 PM
cron job thesnaggle Linux - Newbie 1 09-19-2003 10:47 AM
Cron job T-Rex Linux - Newbie 1 09-26-2001 11:28 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:53 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
Open Source Consulting | Domain Registration