I have a PHP script that I want to run every 10 minutes, going through database records and creating/editing movies through MEncoder. I've set up cron job to accomplish this, but it doesn't work very well.
I have my PHP script, call it document.php. I also have a bash script (document.sh) to call this PHP script;
#!/bin/bash php document.php Now comes the weird part: When I manually run the bash script everything works great - the movies are created or edited just the way I want them - but when I let the cron job run the bash script every 10th minute the movies are corrupt. They have some frames in them, though. I have no clue how this can happen. I've checked the permissions and file paths and everything looks fine. Does the cron job kill my process? Does it have a time limit (it takes roughly 1-2 minutes to run MEncoder through the files)?
Hope someone can provide an answer - this really bugs me and deadline is near.
I'm running Ubuntu Server with the latest updates and the latest MEncoder from the repo.
Best regards, Björn
php document.phpin your crontab and eliminate the Bash script? I agree with Christopher Karel that it's probably an issue with environment variables, however.