LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices


Reply
  Search this Thread
Old 11-03-2007, 05:03 PM   #1
JBull
Member
 
Registered: Jul 2005
Location: Dallas, TX, USA
Distribution: Debian Etch
Posts: 37

Rep: Reputation: 15
Cron Jobs- No log created


I'm running several cron jobs from /etc/crontab but no logs are created. I read up on how to send output to logs but it just won't work for me. What could the problem be? I also tried sending the log to /home/jeff/log.txt sinc the job is being run as user jeff. The job runs but there is no log created. Why?





# /etc/crontab: system-wide crontab
# Unlike any other crontab you don't have to run the `crontab'
# command to install the new version when you edit this file.
# This file also has a username field, that none of the other crontabs do.

SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/FWTools-1.2.0/bin_safe

# m h dom mon dow user command

50 5 * * * jeff world6.py
8 6 * * * jeff makeweekly.sh

00 12 * * * jeff world12.py
11 12 * * * jeff makeweekly.sh

30 16 * * * jeff world12.py > \var\log\weatherlog.txt
20 16 * * * jeff makeweekly.sh > \var\log\weatherlog2.txt

50 18 * * * jeff world18.py
11 19 * * * jeff makeweekly.sh

40 23 * * * jeff world0.py
50 23 * * * jeff makeweekly.sh

17 * * * * root run-parts --report /etc/cron.hourly
25 6 * * * root test -x /usr/sbin/anacron || run-parts --report /etc/cron.daily
47 6 * * 7 root test -x /usr/sbin/anacron || run-parts --report /etc/cron.weekly
52 6 1 * * root test -x /usr/sbin/anacron || run-parts --report /etc/cron.monthly
#
 
Old 11-03-2007, 09:10 PM   #2
macemoneta
Senior Member
 
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
Blog Entries: 2

Rep: Reputation: 344Reputation: 344Reputation: 344Reputation: 344
Your slashes are wrong. Instead of specifying a directory path, you were escaping characters:

For example, "\var\log\weatherlog.txt" means "varlogweatherlog.txt" in the current directory (wherever that is for a cron job). You meant to specify "/var/log/weatherlog.txt".
 
Old 11-03-2007, 09:34 PM   #3
JBull
Member
 
Registered: Jul 2005
Location: Dallas, TX, USA
Distribution: Debian Etch
Posts: 37

Original Poster
Rep: Reputation: 15
DUH!

Such a dumb mistake. I'll fix that and then surely it will work. Thanks for the sharp eye.
 
Old 11-05-2007, 01:17 AM   #4
JBull
Member
 
Registered: Jul 2005
Location: Dallas, TX, USA
Distribution: Debian Etch
Posts: 37

Original Poster
Rep: Reputation: 15
I fixed the slashes and now I'm getting the correct logs.

problem solved
 
  


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
cron hourly, daily, cron.d jobs don't execute eggsmartha Linux - General 3 09-17-2007 06:37 PM
cron jobs bilal_linux Linux - Software 10 04-25-2007 07:49 AM
Cron Jobs christo512 Linux - Software 1 02-09-2006 09:19 AM
cron jobs working2hard Linux - Software 0 07-28-2004 05:31 PM
cron jobs Zyanid Linux - Software 0 08-27-2002 05:10 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop

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