The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Can Cron Job perform backup?

Discussion in 'General Discussion' started by hugo24, Jun 20, 2003.

  1. hugo24

    hugo24 Well-Known Member

    Joined:
    Nov 16, 2002
    Messages:
    90
    Likes Received:
    0
    Trophy Points:
    6
    Hello,

    I have never use CRON JOB before and no idea
    how it works as well.

    I want to backup database for one domain website,
    can CRON JOB do the job?

    Any idea how to do it?

    Thanks

    cPanel.net Support Ticket Number:
     
  2. jackal

    jackal Well-Known Member
    PartnerNOC

    Joined:
    Feb 23, 2002
    Messages:
    708
    Likes Received:
    0
    Trophy Points:
    16
    0 2 * * * mysqldump -uuser_name -ppassword database_name > public_html/nameoffile.sql

    cPanel.net Support Ticket Number:
     
  3. hugo24

    hugo24 Well-Known Member

    Joined:
    Nov 16, 2002
    Messages:
    90
    Likes Received:
    0
    Trophy Points:
    6
    Thanks Jackal,

    But I have no idea how it works.

    Do I type the following code in CRON JOB?

    0 2 * * * mysqldump -uuser_name -ppassword database_name > public_html/nameoffile.sql

    replacing nameoffile.sql to my own file name?

    Do I need to change anything for 0 2 * * * mysqldump -uuser_name -ppassword database_name?

    Or I need to replace the user_name, password and database_name?

    I have 3 database files within the domain.

    Thanks Again.

    cPanel.net Support Ticket Number:
     
  4. jackal

    jackal Well-Known Member
    PartnerNOC

    Joined:
    Feb 23, 2002
    Messages:
    708
    Likes Received:
    0
    Trophy Points:
    16
    change username, password, and database name with the database you wish to backup. Place that line in your cron inside your control panel.

    0 2 * * * that will dump it once a day at 2 am overwriting the day before. If you have 3 databases make a line/cron for each.

    cPanel.net Support Ticket Number:
     
  5. hugo24

    hugo24 Well-Known Member

    Joined:
    Nov 16, 2002
    Messages:
    90
    Likes Received:
    0
    Trophy Points:
    6
    For example:

    Databasename: hugo_forum
    Password: hubgo_123123
    Databaseuser: hugo_userid

    So, it will look like:

    0 2 * * * mysqldump -uhugo_userid -p123123 database_hugo_forum > public_html/forumbackup.sql

    Am I right? :p

    cPanel.net Support Ticket Number:
     
  6. jackal

    jackal Well-Known Member
    PartnerNOC

    Joined:
    Feb 23, 2002
    Messages:
    708
    Likes Received:
    0
    Trophy Points:
    16
    0 2 * * * mysqldump -uuser_name -ppassword database_name > public_html/nameoffile.sql



    Databaseuser: hugo_userid Correct
    Databasename: hugo_forum Correct

    Password: hubgo_123123 Whatever the password is no need for hugo_ if password is 123123 just put in p123123



    cPanel.net Support Ticket Number:
     
  7. hugo24

    hugo24 Well-Known Member

    Joined:
    Nov 16, 2002
    Messages:
    90
    Likes Received:
    0
    Trophy Points:
    6
    oK Thanks...

    Can it be done hourly?

    Where will be the backup file found? Under public_html folder?

    cPanel.net Support Ticket Number:
     
  8. jackal

    jackal Well-Known Member
    PartnerNOC

    Joined:
    Feb 23, 2002
    Messages:
    708
    Likes Received:
    0
    Trophy Points:
    16
    Can it be done hourly? Yes 0 * * * *

    Where will be the backup file found? Under public_html folder? Yes

    cPanel.net Support Ticket Number:
     
  9. hugo24

    hugo24 Well-Known Member

    Joined:
    Nov 16, 2002
    Messages:
    90
    Likes Received:
    0
    Trophy Points:
    6
    Thanks Jackal. ;)

    Will try it out.

    cPanel.net Support Ticket Number:
     
Loading...

Share This Page