Linux Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOperating SystemsLinux Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old March 12th, 2002, 06:25 AM
derrickatdev derrickatdev is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2001
Posts: 464 derrickatdev User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 51 m 27 sec
Reputation Power: 8
Crontab: rewriting a file

Hi,

I need to recreate some php code files using the crontab. I already use the crontab to run several peices of php code for updating databases, but when I try to set up an entry for rewriting a php file I either get an error (stdin: is not a tty) or it does nothing at all.

This is a rough up of what I'm trying:

file1.php: this is the file to be rewritten

file2.php: contains the php code for recreating file1.php
the first line of file2.php is
#!/path to php/php -q

file3.sh: contains the line
/path to file2/file2.php > /path to file1/file1.php

In the crontab I have:

10,30,50 8-16 * * * /path to bash/bash -login -c /path to file3/file3.sh &

============

Hope someone can understand this!
__________________
:-)

Reply With Quote
  #2  
Old March 12th, 2002, 09:26 AM
freebsd freebsd is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2001
Posts: 5 freebsd User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
>> stdin: is not a tty

Because your option (--login) requires interactive. When it's interactive it doesn't read from stdin or ARGV.

Reply With Quote
  #3  
Old March 13th, 2002, 05:06 AM
derrickatdev derrickatdev is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2001
Posts: 464 derrickatdev User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 51 m 27 sec
Reputation Power: 8
Thanks for the reply freebsd.

I tried removing the -login but the code was not run. As far as I can see the -login tells bash to act as a login shell allowing code to be run as if running it from the command prompt.

Any other advice from anyone would be appreciated. Thanks in advance.

Reply With Quote
Reply

Viewing: Dev Shed ForumsOperating SystemsLinux Help > Crontab: rewriting a file


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway