All Questions
141
questions
1
vote
0
answers
56
views
gsutil fails with "OSError: Operation not permitted" when running from cron
I have a php script that does backups. The backups have been failing, because one of the first commands throws an error and stops the script. When I run the script in the terminal, it works just fine. ...
0
votes
0
answers
56
views
Laravel Crons on Elastic Beanstalk Linux AMI 2
I am running a Laravel app on Elastic Beanstalk Linux AMI 2.
I am using the following config file in the .ebextensions folder to set up the cron.
files:
"/etc/cron.d/schedule_run":
mode: &...
1
vote
1
answer
73
views
Hosting resource intensive PHP cron jobs
My website is currently running on a VPS. To make the site work, I have a number of resource intensive cron jobs - and when they are running, my site stop responding/becomes incredible slow.
I'm ...
0
votes
1
answer
1k
views
cron/php how to run command as a non root user
I need to run command (only one command) as a non root user from cron.
Have tried two versions and both fails;
Cron:
* * * * * php script.php
script.php:
exec("whoami"); // returns 'root'
//...
0
votes
1
answer
395
views
How Do I Get Crontab to Run a Whole Directory of PHP Files?
I've created a little program that will generate php files and place them into a '/crons' folder to allow cron jobs to execute the files. These php files will be generated and named dynamically based ...
0
votes
0
answers
366
views
How do you debug a cronjob that's not working?
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
$_SERVER['SERVER_SOFTWARE'] = 'Apache';
$_SERVER['HTTP_USER_AGENT'] = 'PHP';
$_SERVER['PHP_SELF'] = '/wp/wp-...
0
votes
1
answer
456
views
Cronjob Files Not Closing and 100% CPU usage
I'm running a php file every 10 seconds with a cronjob. While the system was running fine, I noticed last night that php was using 100% of the CPU and crashing the system.
When I checked with ps aux, ...
1
vote
1
answer
92
views
Crontab - How to verify a PHP script Runs Successfully or not in a Cronjob Shell Script?
I have below crontab in the system (Centos 7.9), However i am unable to verify if this runs correctly or not,
i.e if the crontab finds the PHP enr. variables or if the crontab has executed correctly ...
1
vote
1
answer
155
views
Uniform Server cron not executing php script
I'm running Uniform Server Zero XIV and am trying to use the cron to run a php script every 15 minutes. When ran manually, the script does what it is supposed to, which is updating values in a ...
0
votes
1
answer
421
views
While a process is running manually, it stops after a while in the cron job [duplicate]
I have a PHP script and this script loops thousands of lines. When I run the PHP file manually, this loop of thousands of lines returns successfully. But when a cron job does this, it turns around 143 ...
0
votes
2
answers
232
views
How to stop requests on PHP server while it is running cron job sheduled PHP script?
I have a situation when some DDOS attacks are putting my PHP server down. Occasionally.
I'm using AWS with auto scaling groups, so it is not a problem.
The problems start when this server is going ...
-1
votes
1
answer
52
views
php core script not getting called from Crontab
I am using core PHP and written a simple script that needs to be called automatically. For testing purpose I have just written a print statement as below,
$host = 'localhost';
$user = 'admin';
$pass = ...
0
votes
1
answer
548
views
How to kill the php page ran via Cron if it is still executing
I don't know whether this is right place to post this, if not please bear with me.
I have CRON that executes PHP page at 03:00 am.
This php page, goes through several data, that it takes an average 1 ...
0
votes
0
answers
15
views
Cronjob stopped working. But cron and php script still work? [duplicate]
I did a ImageMagick install on my CentOS webserver and afterwards my cronjobs do not work anymore.
I have cronjobs that executes php files. For example one cronjob execute every 15 minutes a php file ...
0
votes
1
answer
1k
views
What is causing our PHP script to stall?
I have a long-running CLI cron job written in PHP. After an inconsistent period of time, the script stops writing output to its log file, indicating that it has stopped executing.
However, the script ...
1
vote
0
answers
127
views
PhP Session Destruction not as eXpected
I have added this code to the top of my page and it is executed when a user login.
<?php
$lifetime=86400;session_start();setcookie(session_name(),session_id(),time()+$lifetime,"/","","TRUE","...
5
votes
1
answer
6k
views
What is the best way to run cronjob in AWS ECS?
I have a web app powered by Laravel that is set up on AWS ECS. I would need to run an artisan command as a cronjob.
I'm looking at "Scheduled Tasks" in ECS Cluster configuration. I can launch new ...
0
votes
2
answers
3k
views
BASH-create a 'www-data' crontab that runs a PHP file
I need to get this to run in a cron file in /etc/cron.d/:
*/15 * * * * php -f /var/www/nextcloud/cron.php
...but, my scripts don't run. It's permissions are set to 644 and I need to create it with a ...
0
votes
0
answers
91
views
Mysql Unable to connect to the database - time to time
We have problem to run php script via crontab. There are around 70 lines that run scripts installed in different virtual servers. When few lines are executed everything is working but when we have ...
0
votes
1
answer
1k
views
Send mail via cronjob/php, RHEL
I am trying to send an e-mail by a cronjob using a php script.
The script itself works fine when executed in a shell.
When it is run by cron, the attachment is missing.
OS is RHEL 7
Cron entry :
30 ...
0
votes
1
answer
1k
views
500 error for PHP script with cron, but not CLI
I have a PHP script which I am trying to run via cron. In cron I have
php /home/dir/dir/foo.php
When the command runs, the cron log says:
Status: 500 Internal Server Error
X-Powered-By: PHP/7.1.16
...
0
votes
0
answers
198
views
Cron Job not starting and did everything to the point
I know this question has been asked many times before in this page but I am still stuck.
I am using a DigitalOcean droplet to run a website whose main function is to send multiple emails a day to ...
0
votes
1
answer
410
views
Cron job on google compute engine debian linux is failing silently
I'm trying to get my cron jobs to output errors if the cron job fails. I've created a command that will purposefully fail to try and test this, like so:
* * * * * php /var/some/nonexistent/script....
0
votes
1
answer
1k
views
Which user should run my PHP cron job?
I have a bunch of PHP scripts are run by cron (/etc/crontab) at specific times. The scripts are owned by www-data. However, www-data does not have shell access. In fact, it has "nologin" set as its ...
0
votes
1
answer
71
views
running multiple crons through one job
My (free) webhoster allows me to run ONE cronjob (through their web interface). But I need to run Two. One cronjob every 10 minutes, and another one every Hour.
They're both PHP-files. Is there a way ...
3
votes
1
answer
14k
views
Cron Error getpwnam() failed for DB back up
Trying to learn how to implement a cron job using php.
cron is formatted like so /etc/crontab
* 13 * * * /usr/bin/php /var/www/path/to/file/database-bkup-test.php &>/tmp/mycroncommand.log
...
0
votes
1
answer
157
views
Multiple crons at same interval fails - linux crontab
In my server, I have scheduled following set of cron files.
00 21 * * * /bin/sh /path/db_backup.sh
*/2 * * * * /usr/bin/php /path/file1.php
*/2 * * * * /usr/bin/php /path/file2.php
...
*/2 * * * * /...
1
vote
1
answer
2k
views
Nextcloud cron.php timings
As recommended by Nextcloud Official Documentation, I started to use a system that calls the cron.php every 15 minutes. The call is wrapped in a program that reports errors to me via e-mail and ...
1
vote
2
answers
4k
views
crond: can't set groups: Operation not permitted
This morning I upgraded my PHP version to 7.1 and am seeing an issue when cron tries to run php /var/www/html/artisan schedule:run (a simple PHP command) I see the output:
3/3/2017 10:39:00 AMcrond: ...
0
votes
1
answer
282
views
php ssh2_exec hangs on "crontab -e" command
I connected to remote server with ssh2_connect. In my secure log I got
Feb 22 11:41:57 centos sshd[3243]: Accepted publickey for subscr from 83.166.241.41 port 53306 ssh2
Feb 22 11:41:57 centos sshd[...
1
vote
1
answer
1k
views
Cronjob not executing only *one* php script
Okay, I have a php script that has to be executed each 15 minutes, but that does not work. My other scripts just get executed just fine, and I can execute it via the command line.
# m h dom mon dow ...
0
votes
1
answer
86
views
Trying to manipulate cronjobs using php
Good day,
Im trying to create a script to add, remove and list cronjobs inside the servers using php. Whenever I run the command like this php cronjobs.php the output is correct , but if i call it ...
-1
votes
2
answers
1k
views
Can PHP have not root permissions, if it is runned via root cron job?
In /etc/crontab i see a job like this:
15 15 * * * root /usr/local/bin/php /path/to/script.php
So, with some other settings, cat this php script have not root access, when runned?
My ...
2
votes
0
answers
733
views
Elastic Beanstalk and Worker Tier? (PHP)
I'm trying to setup my app that's hosted on EB with a worker that will run some basic cron jobs to feed an RDS database with data that the app consumes.
I deployed this cron.yamlat first:
version: 1
...
0
votes
1
answer
593
views
%CPU at 99% when cronjob runs php script every minute
I am using a debian server and for some reason when I run this php script using crontab every minute it says that I am using 99% of the %CPU with the php command (in the cronjob the command is php) ...
0
votes
1
answer
2k
views
Cron Job error says ioncube is not installed when it is
I have a website (mivprofit.com) and this website works with a script that requires a couple of cron jobs to run once a day. I have a cron email set and whenever the cron job runs this is the email ...
3
votes
3
answers
6k
views
Cron appears to run but doesn't execute in the same way as when run manually from the terminal [duplicate]
I have a php script that connects to an external API returns some data and updates a database table. I can run this directly via my command line / SSH terminal and it works fine (takes about 5 minutes ...
0
votes
2
answers
4k
views
Running cron job manually and immediately with PHP
I just wanted to run all my cronjob manually and immediately, following command works well in command line terminal but not working with shell_exec
crontab -l | grep -v '^#' | cut -f 6- -d ' ' | ...
1
vote
1
answer
330
views
php script from sh from crontab die with no traces
in my crontab there is a script starting at 2:40 AM, executing some routines both from sh commands and php scripts starting from sh files.
the line in crontab looks like this:
SHELL=/BIN/BASH
PATH=/...
1
vote
1
answer
904
views
Executing php as sudo inside crontab [duplicate]
I've wrote a PHP-Script, and the execution requires sudo permission, because it executes some other system related stuff. So i've added this into the crontab -e but i can't see, that my script is ...
0
votes
1
answer
958
views
Cron job with PHP script doesn't work properly
One of my customers have PHP script which loads cvs file. When he execute this script via WWW it works properly - logs of loaded data are stored in /var/php/CLIENT/loaded.log. But when i try to ...
0
votes
0
answers
2k
views
php curl does not execute url
Im writing a php cron script that needs to run a url
After some database modifications the php script needs to execute an url
$url = 'http://server.domain.com/cronjob.php?idorder='.$orderid.'&...
2
votes
2
answers
2k
views
Symlink in crontab, script not found [duplicate]
I'm running Debian testing and can't get a simple cron to run a symlinked PHP script.
I've a php script in a subdirectory in my home folder /home/foobar/dir/script.php (which starts with the ...
-1
votes
1
answer
3k
views
Cron job is not working in centos 6.6
I have dedicated server having centos 6.6 and centos webpanel. Now I'm trying to set cron job from centos web panel. I had tried so many commands to run one php file each and every minute, but still ...
1
vote
1
answer
231
views
Kill old php cron script
After running ps aux | grep php, I found about 10 php scripts ran by cron that have started over a week ago and are hanging.
Each script usually take 40 seconds to complete.
I have set ini_set('...
8
votes
4
answers
5k
views
cron job sending emails in a wrong charset
I have following command in a cronjob:
*/5 * * * * php /var/www/domain/yii rss/parse
It outputs email in a wrong charset:
Content-Type: text/plain; charset=ANSI_X3.4-1968
But when i launch that ...
-1
votes
3
answers
3k
views
Is there a way to restart automatically the HHVM service if I get a '502 Bad Gateway Error'?
I've reported the error on stackoverflow - from time to time my Nginx/PageSpeed+HHVM+MariaDB+WordPress blog stops working. There is some problem with the HHVM service that I don't locate, and I'm ...
-4
votes
3
answers
1k
views
cronjob or similar to open a local php file including query [closed]
How do I open the following file with cronjob correctly every 5 minutes:
/var/www/mysite/folder/foo.php?query=1
I tried myself but I just did not get it working. I tried with /usr/share/php5, wget, ...
1
vote
1
answer
3k
views
Problems with a PHP include from the command line (or cronjob) [closed]
I am trying to setup a cronjob on my AWS EC2 instance. There is nothing wrong with the actual entry in the crontab file but when I try to run the command in the command line I get this response.
PHP ...
0
votes
1
answer
4k
views
run multiple instance of same php script from bash
I am running a cron job to execute a php file multiple times per minute like this
* * * * * /usr/bin/php /var/www/html/myFile.php >> /var/www/html/cronlog 2> /dev/null
* * * * * ...