Cron stopped working after end of September

Status
Not open for further replies.

spadija

New Member
Messages
48
Reaction score
1
Points
0
I have a cron job set to email me a backup of my site's database every night, and it was working perfectly until October 1. The last email I received was on September 30 and my inbox still has a good 7.4GB of free space.

My site is chaosinacan.com (or chaosinacan.x10hosting.com) and is running on Starka. Is there a reason why cron stopped working, and more importantly, can it be fixed?
 

stpvoice

Community Support Rep
Community Support
Messages
5,987
Reaction score
212
Points
63
Some other users are reporting problems with cron on starka at the moment. I'm sure admin are looking into it. :)
 

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
Can you call the script from the Web? And if so, does it work?

Trying to narrow the problem between cron, email, and the backup script.
 

spadija

New Member
Messages
48
Reaction score
1
Points
0
The script is a .sh file, so I don't think I can call it from the web.

This is the script (minus personal data) which worked up until October.
Code:
DBNAME=spadija_<database>
DBPASS=<my password>
DBUSER=spadija_root
EMAIL="<my gmail>"
SUBJECT="Chaos in a Can Backup"
DATE=$(date +%m-%d-%Y)
mysqldump -ce --user=$DBUSER --password=$DBPASS $DBNAME | gzip | uuencode backup-$DATE.sql.gz | mail -s "$SUBJECT" $EMAIL

I can send email to the same address from my site via PHP. I'm also not getting any email notifications saying the cron failed. (Things like "mysqldump: Got error: 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) when trying to connect")
 

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
Should be fixed now.

Email notification of crons should be turned off (was flooding the email server when tons of people have 5 min crons).

Cron job code like:

Code:
/usr/bin/php /home/igor/public_html/mycronjob.php  >> /home/igor/public_html/cronlog.txt  2>&1

will give you a log which includes errors and any stdout output of your script.
 

spadija

New Member
Messages
48
Reaction score
1
Points
0
Alright. It's working again.

Is there a way to write an equivalent script in PHP? Since PHP's mail function works, that would make my script no longer dependent on email notification, but I have no idea how to do something like mysqldump from PHP, since I'm going to assume system() is probably blocked to keep it from being abused.

Thanks!
 
Status
Not open for further replies.
Top