March 12th, 2002, 06:25 AM
Crontab: rewriting a file
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!
March 12th, 2002, 09:26 AM
>> stdin: is not a tty
Because your option (--login) requires interactive. When it's interactive it doesn't read from stdin or ARGV.
March 13th, 2002, 05:06 AM
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.