Mobile app version of vmapp.org
Login or Join
Murphy175

: Sentora database dump works when run from command line, but not from cron The Setup I'm running a webserver with CentOS 7.1 x64, Sentora, and suhosin module preinstalled. I need to trigger

@Murphy175

Posted in: #Cron #Database

The Setup

I'm running a webserver with CentOS 7.1 x64, Sentora, and suhosin module preinstalled.

I need to trigger a PHP script which does this (among other things)

echo exec('mysqldump -u'.USER.' -p'.PASSWORD.' '.DATABASE.' | gzip > '.$fileName.'.sql.gz');


In order to be able to do that, I have removed the exec from suhosin's blacklist, both via the Sentora admin panel, and by removing exec from the list of blacklisted commands in /etc/sentora/panel/modules/cron/code/controller.ext.php.

As stated on the official site, I've ensured that the owner of both /var/spool/cron and var/spool/cron/apache is apache, and that the permissions are correct (770 and 660, respectively)

The Problem

When I create a new cron job, by using Sentora's Cron Manager, the cron is not doing what it's supposed to (dumping and zipping the database), even though it's triggering the PHP script. I can confirm that the script has no issues, since it does what it's supposed to do when I activate it manually (via browser).

I can also verify that the cron is running - crontab -u apache -l returns:

#################################################################################
# CRONTAB FOR SENTORA CRON MANAGER MODULE
# Module Developed by Bobby Allen, 17/12/2009
# File automatically generated by Sentora 1.0.3
#################################################################################
# NEVER MANUALLY REMOVE OR EDIT ANY OF THE CRON ENTRIES FROM THIS FILE,
# -> USE SENTORA INSTEAD! (Menu -> Advanced -> Cron Manager)
#################################################################################
# CRON ID: 6
* * * * * php -d suhosin.executor.func.blacklist="passthru, show_source, shell_exec,
system, pcntl_exec, popen, pclose, proc_open, proc_nice, proc_terminate, proc_get_status,
proc_close, leak, apache_child_terminate, posix_kill, posix_mkfifo, posix_setpgid,
posix_setsid, posix_setuid, escapeshellcmd, escapeshellarg"
-d open_basedir="/var/sentora/hostdata/zadmin/:/var/sentora/temp/"
/var/sentora/hostdata/zadmin/public_html/my_subdomain/cron/cron.php


What am I doing wrong? If it's of any relevance, I'm doing all of this for a subdomain.

10% popularity Vote Up Vote Down


Login to follow query

More posts by @Murphy175

0 Comments

Sorted by latest first Latest Oldest Best

Back to top | Use Dark Theme