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 07-26-2005, 12:59 PM   #1
shole
LQ Newbie
 
Registered: Nov 2003
Location: KL, M'sia
Distribution: FC3 on P!!!1G 512MB RAM
Posts: 27

Rep: Reputation: 15
Talking simple "echo > qbc" cron jobs doesn't run


Hello

I need to update my DB twice a day.
So I started to do some experimenting on cron but it just doesn't work for me.

I tried it on my PC (FC3) and server (CentOS 3) but the results are the same.

My script looks like this
Quote:
#!/bin/sh
date > output
echo testing testeeing testening >> output
date >> output
By right it should output the results into a txt file (output) right.
But it doesn't.

I have run it on a terminal and the script woks fine.

I even tried it in an at job, it also works.

But for cron no results were found.
My "crontab -l" returns
Quote:
01 01 * * * /home/intuition/insert.sh
It should be running everyday at 0101 right. But it didn't

My /var/log/cron looks like this
Quote:
Jul 27 00:59:16 anima crontab[2925]: (root) LIST (root)
Jul 27 00:59:54 anima crontab[2929]: (root) REPLACE (root)
Jul 27 00:59:58 anima crontab[2930]: (root) LIST (root)
Jul 27 01:00:01 anima crond[1988]: (root) RELOAD (cron/root)
Jul 27 01:01:01 anima crond[2941]: (root) CMD (/home/intuition/insert.sh)
This is what I did
1. I type "crontab -e" and entered
01 01 * * * /home/intuition/insert.sh

2. I then entered ":wq" to write and quit the editor

Did I do something wrong?

I have even tried
crontab -l > mycron

then
vi mycron and entered 10 01 * * * /home/intuition/insert.sh

finally
crontab mycron

when 0110 come still no results

Please give some insights, please ...
 
Old 07-26-2005, 02:24 PM   #2
Artanicus
Member
 
Registered: Jan 2005
Location: Finland
Distribution: Ubuntu, Debian, Gentoo, Slackware
Posts: 827

Rep: Reputation: 31
I ran the exact same entries (except the time ofcourse) and got the outputfile correctly in my home folder.

A few things to try out:
- Give 'output' an absolute path, tho it did work with just output for me
- activate / install sendmail. Youll get any errors in a mail, sent to your user.

Now, im running dcron (Dillon's Cron daemon) that came with slackware, so the difference could be actually another crond, but the syntax should be the same.
 
Old 07-26-2005, 08:47 PM   #3
shole
LQ Newbie
 
Registered: Nov 2003
Location: KL, M'sia
Distribution: FC3 on P!!!1G 512MB RAM
Posts: 27

Original Poster
Rep: Reputation: 15
solve

10s for the idea Artanicus
i change my script to absolute path and it worked

what a silly mistake

peace....
 
Old 09-23-2006, 02:09 PM   #4
jahvascriptmaniac
Member
 
Registered: Aug 2006
Posts: 34

Rep: Reputation: 15
Yeah, but now you have a random "ouptut" file on your hd
 
  


Reply

Tags
redundant



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
info to run "cu" command from cron tcore Mandriva 5 12-27-2018 11:34 AM
How can I run the "cu" command under cron? tcore Linux - General 1 03-08-2005 07:45 AM
system("top") in a C program giving problems when the C prg is run by cron rags2k Programming 1 09-02-2004 03:25 PM
Extra cron jobs not in "crontab -e"? inspleak Linux - General 2 07-21-2004 09:47 PM
"segmentation fault" when run a simple c program acer_peri Programming 11 05-28-2004 04:14 AM

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

All times are GMT -5. The time now is 11:44 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