I am a Unix/Linux n00b. I have a VPS running CentOS with WHM/cPanel. I comissioned the installation of ASSP Deluxe, which is a third-party anti-spam solution. Everything works great.
One of the cronjobs configured by ASSP Deluxe is a PHP script that looks up the list of domains/subdomains installed on the server and automatically rebuilds a plain text file with a list of these domains, one per line.
The cron entry in question is this:
*/59 * * * * /usr/local/cpanel/3rdparty/bin/php-cgi /usr/local/assp/deluxe/ex_localdomains.php
What I need to do is add a fixed extra line manually to the end of this file with the list of domains. Doing it manually with a text editor works, but as the cronjob runs every hour, my line is wiped out every hour.
The easy way would be to add some code to the end of the executed PHP file to do this, but the PHP file is ionCube-encoded, so that is a no go.
Instead, I have created a PHP script that appends a line to the end of the file. Executing this command in this way through SSH (root logged in)...
...works great! It adds the line I need to the end of the file. So I amended the cronjob in crontab (crontab -e) to the following:
*/59 * * * * /usr/local/cpanel/3rdparty/bin/php-cgi /usr/local/assp/deluxe/ex_localdomains.php && /usr/local/cpanel/3rdparty/bin/php-cgi /usr/local/assp/deluxe/add_manual_domain.php
I assumed this would perform the rebuild, and then run my script to add the line to the end of the file once the rebuld completes.
However, it doesn't do this. The file is rebuilt successfully, but the extra line is not added to my file. Running my little PHP script manually from command line, however, works.
Can anyone shed some light on this?