
February 27th, 2006, 01:07 PM
|
|
Contributing User
|
|
Join Date: May 2004
Posts: 112
  
Time spent in forums: 14 h 31 m 46 sec
Reputation Power: 6
|
|
|
Shell script problems when running on CRON... Any suggestions?
I'm having a little trouble with this. Once a night this script runs. Basically it just runs a php file, if there are orders the PHP file makes "ORDERMMDD.DMC" if there are no orders it does nothing.
Now my problem is I don't want to FTP if there is no orders, so I tried to write this script to see if there is a file with .DMC extension.
Is there a better way to check if there is a .DMC extension in the directory?
Any help would be appreciated!
PHP Code:
#!/bin/sh
wget --delete-after https://mydomain/format_order.php
FILENAME=`(set \`ls ORDER*.DMC\`; echo $1)`
A=ORDER
B=`(set \`date +%m%d\`; echo $1)`
C=.DMC
if [ "$FILENAME" == "$A$B$C" ]; then
ftp -n ftp.myotherserver.com <<EOFTP
*FTP COMMANDS WORKING OK*
EOFTP
mv $FILENAME storage/
fi
|