Cron job to backup database

Markstar

New Member
Messages
45
Reaction score
0
Points
0
Hi,
I'm a total cron newbie, but I would like to backup my database every day and send it to my x10 email account. I hear crons are the way to go, sadly I could not find anything here in the forum.

All I know is that I can set up the cron job, together with the interval, in the cpanel. :redface:

Thank you in advance for your help!
 

lemon-tree

x10 Minion
Community Support
Messages
1,420
Reaction score
46
Points
48
First, you'll want to download and install a tool such as PHPMYBackupPro. That script does have a built in scheduler, but I'm not sure it works here on x10, so you may have to run the php script directly from a cron job.
To setup a cron job, on cPanel and navigate to 'Cron Jobs'. Set the time interval you desire and in the command field enter the following, adding the correct path to the file:
/usr/bin/php -q /home/YOUR_USERNAME/public_html/PATH_TO_FILE
 

batman1

New Member
Messages
92
Reaction score
0
Points
0
I think it works, I used one once to backup my database. But it wasn;t with cron
 

Markstar

New Member
Messages
45
Reaction score
0
Points
0
Alright, upon your advice I have downloaded and installed MySQLDumper.

Everything seems to be working, I can manually make and restore backups via the PERL script. However, when I activate the option "Send email report", I get the following error:
Finished backup of database `markstar_01`.
Sending E-Mail ...
Software error:

Can't locate Email/Date/Format.pm in @INC (@INC contains: /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/5.8.8 . ) at /usr/lib/perl5/site_perl/5.8.8/MIME/Lite.pm line 1092.
I don't know what it means, but it is very well possible that I have made an error in the configuration of the email account (either in the cpanel or in MySQLDumper).

In MySQLDumper, you can either select to send emails via "sendmail" or "SMTP". I am not sure which is the right one or what exactly I have to enter as options.
For "sendmail", the default setting is:
Code:
/usr/sbin/sendmail -t -i
For "SMTP", it says: "localhost" for port 25.

But selecting either option does not work. :( Am I missing something?

Kind regards
Mark

P.S.: I can successfully check emails of my x10hosting email account from Thunderbird, so that part is working...
 
Top