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.

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:
    1
    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
     
  2. kuldeep_

    kuldeep_ Well-Known Member

    Joined:
    Apr 24, 2010
    Messages:
    54
    Likes Received:
    0
    Trophy Points:
    6
    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 :)
     
  3. wasimansha

    wasimansha Member

    Joined:
    Jul 13, 2010
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    London,UK
    Thanks a lot kuldeep, you are a life saver.:D
     
  4. kuldeep_

    kuldeep_ Well-Known Member

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

    Thanks for the appreciation. :)
     
Loading...
Similar Threads - Cron Job Backup
  1. mesut85u2
    Replies:
    14
    Views:
    1,320

Share This Page