Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Cron Job for DB Backup

Discussion in 'cPanel Developers' started by wasimansha, Jul 13, 2010.

  1. wasimansha

    wasimansha Member

    Joined:
    Jul 13, 2010
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    51
    Location:
    London,UK
    i am trying to make a script file which will execute once a week by cron job and it will take the backup of my DB. I am using Unix server with cpanel.
    can any one help me here PLEASE
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  2. kuldeep_

    kuldeep_ Well-Known Member

    Joined:
    Apr 24, 2010
    Messages:
    54
    Likes Received:
    0
    Trophy Points:
    56
    You can use following cron to backup database weekly.

    HTML:
    0	0	*	*	0 	mysqldump –u database_user –pDatabase-Password database_name > database_name-`date “+%Y-%m-%d”`.sql
    
    Above cron will backup database on midnight sunday of every week.

    That's all :)
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. wasimansha

    wasimansha Member

    Joined:
    Jul 13, 2010
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    51
    Location:
    London,UK
    Thanks a lot kuldeep, you are a life saver.:D
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. kuldeep_

    kuldeep_ Well-Known Member

    Joined:
    Apr 24, 2010
    Messages:
    54
    Likes Received:
    0
    Trophy Points:
    56
    Hey Wasim,

    Thanks for the appreciation. :)
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice