A
A
Alexander2014-03-19 16:07:54
PHP
Alexander, 2014-03-19 16:07:54

How to solve the problem with executing .sh through Cron?

Good afternoon!
CentOS 6
/etc/crone is 10 10 * * * root /opt/mvv/1.sh
Contents of 1.sh :
#!/bin/bash
cd /opt/mvv/
/usr/bin/php /opt/mvv/ main.php -r
main.php - creates a sql query to upload files
a file of 1 KB is loaded for a couple of seconds
a file of 300 KB minutes 5.
Bottom line: everything works with smaller files, but nothing happens with larger ones (as I understand it , .php is stalled).

Answer the question

In order to leave comments, you need to log in

5 answer(s)
I
Ivan Somov, 2014-03-19
@jsom

check in php.ini upload_max_filesize

G
Gisma, 2014-03-19
@Gisma

That's right, most likely the problem is in php. The problem in such cases happens for 3 reasons: - 300k
file contains data format errors, maybe php crashes due to a program error
- time limit exceeded
- memory limit exceeded
To catch the bug, run the php script in a controlled environment:
- error_reporting(E_ALL)
- remove startup time limit - set_time_limit(0)
- increase memory limit - ini_set('memory_limit','256M');

A
Alexander, 2014-03-19
@roro_4x

Let me clarify one very important point.
The .sh itself all works fine, the problem occurs when running the script via cron !

S
ShamblerR, 2015-07-15
@ShamblerR

there are several options
1. see if your domain is paid for using the whois service
2. Is hosting paid because hosting can redirect homeless people to the left pages if the account is not renewed, which is strange but technically possible.
3. You have a virus ;) congratulations, look at .htaccess if there is a lot of unnecessary code in it, then treat the site.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question