+ Reply to Thread
Results 1 to 5 of 5

Thread: Cron job to backup database

  1. #1
    Markstar is offline x10Hosting Member Markstar is an unknown quantity at this point
    Join Date
    Nov 2008
    Posts
    45

    Question Cron job to backup database

    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.

    Thank you in advance for your help!

  2. #2
    lemon-tree's Avatar
    lemon-tree is offline x10 Minion lemon-tree has a spectacular aura about
    Join Date
    Nov 2007
    Posts
    1,420

    Re: Cron job to backup database

    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

  3. #3
    batman1's Avatar
    batman1 is offline x10Hosting Member batman1 is an unknown quantity at this point
    Join Date
    Aug 2008
    Location
    Jamaica
    Posts
    92

    Re: Cron job to backup database

    I think it works, I used one once to backup my database. But it wasn;t with cron

  4. #4
    Markstar is offline x10Hosting Member Markstar is an unknown quantity at this point
    Join Date
    Nov 2008
    Posts
    45

    Question Re: Cron job to backup database

    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...

  5. #5
    Markstar is offline x10Hosting Member Markstar is an unknown quantity at this point
    Join Date
    Nov 2008
    Posts
    45

    Re: Cron job to backup database

    Nobody?

+ Reply to Thread

Similar Threads

  1. HOWTO: Auto-backup database | transfer database (with pics)
    By galaxyAbstractor in forum Tutorials
    Replies: 3
    Last Post: 02-21-2010, 03:35 PM
  2. Cron daily backup script
    By taha116 in forum Scripts & 3rd Party Apps
    Replies: 8
    Last Post: 06-30-2009, 05:37 PM
  3. Replies: 1
    Last Post: 07-23-2008, 03:37 AM
  4. FTP backup cron job?
    By componentwarehouse in forum Programming Help
    Replies: 3
    Last Post: 07-05-2008, 12:28 PM
  5. Scritp+backup+cron
    By davidbe in forum Soporte
    Replies: 4
    Last Post: 02-12-2007, 02:30 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers