Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums
Old 03-12-2003, 09:33 AM   #1 (permalink)
Antagony
Registered User
 
Antagony's Avatar
 
Join Date: Mar 2003
Posts: 31
Antagony is on a distinguished road
Send a message via ICQ to Antagony
Question CRON misfunctionality

I'm totally stumped.

I created a script that I want to run every minute. I know how to set this up in CRON, that isn't my question here today. Quick Summary: If I run the script manually it works fine, but if CRON runs it, it decides to quit early (or something).

Okay, the first part of the script is what's messing up. All it does is run a command and direct the output to a text file, ie, "ls /home > dir.txt". Like I said, the script works perfectly if I manually run it. But when CRON runs it, it opens the proper text file but only puts out the FIRST LINE of the expected output. What the crap?

Anyone have any clues as to why this might be happening?

Any help would be appreciated by myself and my keyboard (it's tired of having my face being slammed on it).
Antagony is offline   Reply With Quote
Old 03-12-2003, 03:29 PM   #2 (permalink)
EscapeCharacter
GNU/Punk
 
EscapeCharacter's Avatar
 
Join Date: Jul 2002
Location: stuffs
Posts: 66
EscapeCharacter is on a distinguished road
Send a message via AIM to EscapeCharacter
i think the redirection part is messing it up usually cron wants the ouput of the script to goto the users mail. dont know if thats the problem but you could try sending the output to a variable instead. like
BLAH=`ls /dir`
__________________
cd /usr/ports/misc/life && make install
EscapeCharacter is offline   Reply With Quote
Old 03-20-2003, 09:57 PM   #3 (permalink)
Antagony
Registered User
 
Antagony's Avatar
 
Join Date: Mar 2003
Posts: 31
Antagony is on a distinguished road
Send a message via ICQ to Antagony
Thanks for the tip, but I ended up re-writing the script to run as a daemon with it's own time delay function, so no more need for cron
Antagony is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

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
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
CLI for noobies: stay regular with cron and crontab sde Code Newbie News 1 04-05-2004 05:24 PM
running PHP with a cron? Admin PHP 4 01-08-2003 11:16 AM
more cron jobs sde Linux / BSD / OS X 4 06-03-2002 08:29 AM
Help!!! Cron Job Gone Crazy!!! sde Linux / BSD / OS X 3 05-23-2002 06:46 PM


All times are GMT -8. The time now is 01:44 PM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0 RC8





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting