Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I write a PHP script that needs to be run through CRON. I am using Fedora 7 with plesk 8.3.
this script call ffmpeg binary to convert a video file under one of virtual domain hosted on above server, and save the converted file in subfolder subfolder of cron folder.
when I run this php script as same user underwhich I set cron it save the converted file perfectly. however, when I wait for cron to execute. IT does execute the script but doesn't save the converted file. Also it is not sending as message email I put for error tracking.
I write a PHP script that needs to be run through CRON. I am using Fedora 7 with plesk 8.3.
this script call ffmpeg binary to convert a video file under one of virtual domain hosted on above server, and save the converted file in subfolder subfolder of cron folder.
when I run this php script as same user underwhich I set cron it save the converted file perfectly. however, when I wait for cron to execute. IT does execute the script but doesn't save the converted file. Also it is not sending as message email I put for error tracking.
Can anyone please suggest whats need doing ?
Have you checked the cron logs to see if you're getting any errors? Also, check the cron job itself...if it's trying to write to a log file (for status messages, etc.), make sure that file and directory exist, otherwise the job will blow off.
Have you checked the cron logs to see if you're getting any errors? Also, check the cron job itself...if it's trying to write to a log file (for status messages, etc.), make sure that file and directory exist, otherwise the job will blow off.
Hello,
I check the cron log and it shows that cron run on time.. no error reporting.
I run same script through SSH and it execute perfectly, it write log file and save ffmpeg converted video as well. However, when I run it through cron, it won't write log file and doesn't save ffmpeg video as well.
Since it is able to update the Database, I add new table in db for log and run insert query just after my EXEC function for ffmpeg and it does insert in row. but all my tracing data are blank.. except that return value of EXEC php function is 1. (which I suppose is for success ?)
I check the cron log and it shows that cron run on time.. no error reporting.
I run same script through SSH and it execute perfectly, it write log file and save ffmpeg converted video as well. However, when I run it through cron, it won't write log file and doesn't save ffmpeg video as well.
Since it is able to update the Database, I add new table in db for log and run insert query just after my EXEC function for ffmpeg and it does insert in row. but all my tracing data are blank.. except that return value of EXEC php function is 1. (which I suppose is for success ?)
Does the cron job echo data to a log file??? This is what I asked in my first post...if you're putting your info into a log file and you have something like this at the end of the cron job:
/log/job-log-file.txt 2>&1&
you're redirecting stdout and stderr to that file, in that directory. If that directory and log file doesn't exist, your cron job will fail. You can put a ton of commands into your script, and if it's running from the command line, it's working.
Also, you may want to check your path, come to think of it. That user may have php in the path, but since the cron job runs (I assume), as root, php may not be in the path. Try to use an explicit path for the php binary, and see what happens.
I was not logging data in log file as you suggest. I did that nad also I read somewhere that I need absolute path to make it happen, even though my script is doing chdir i still need Complete Abolsute path from / mount point to make it run.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.