Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Jan 2012
    Posts
    1
    cPanel/Enkompass Access Level

    Root Administrator

    Default Need help in backing up of databases.

    Hi Everyone,

    I am new to DBA stuff. I wonder if anyone can help me. Task is that, I have 10 databases and need to take backups of all the databases using data pump in Unix/Linux, compress them using gzip and use cron to schedule the job twice a day.

    Appreciate if anyone can help me in this. I was trying this for a week but no luck.

    Thanks,
    Sreepriya

  2. #2
    cPanel Staff cPanelTristan's Avatar
    Join Date
    Oct 2010
    Location
    somewhere over the rainbow
    Posts
    6,305
    cPanel/Enkompass Access Level

    Root Administrator

    Default Re: Need help in backing up of databases.

    What have you done so far command wise so we know what parts are and are not working?
    cPResources: Support Options | More Support Options | Forums Search | cPanel.net Site Search | Mailing Lists(Alt) | Docs
    -- Tristan, Forums Technical Analyst, cPanel Tech Support

    Submit a ticket | Check an existing ticket

  3. #3
    Member hostmedic's Avatar
    Join Date
    Apr 2003
    Location
    Ohio
    Posts
    556
    cPanel/Enkompass Access Level

    DataCenter Provider

    Default Re: Need help in backing up of databases.

    Well - backing up one time is pretty simple - as long as you know your mysql user/pass (depending on your setup you may not need that from the command line either... )

    To backup a single database via SSH - simply do the following @ the command line (cli)

    mysqldump --add-drop-table -u db_username -p db_name > mybackup.sql
    (Omit the –add-drop-table argument if you’ll want to merge this backup with an existing database upon restore)
    (Replace db_username with the name of your database user )
    (Replace db_name with the name of your database )
    (Replace mybackup.sql with the name of your backup file )

    Another alternative would be to do each together - I have used this in the past - and simply set to perform daily via a cron job

    * * * * * mysqldump -u root -pPASSWORD --all-databases | gzip > /filepathhere/database_`data '+%m-%d-%Y'`.sql.gz

    of course you could always run that from the command line as well - be sure to change the /filepathhere/ to where you want it to go.

    Now - If you are looking for a much better backup approach however I suggest using a script called AutoMySQLBackup has all the features most need:

    1. simple database backup
    2. multiple database backups
    3. ability to compress (gzip or bzip2) the backups to save on storage
    4. rotate backups to save space and cut down on old garbage.
    5. email when done/ logs etc ...

    The installation is very simple: just download the one file bash script and save it somewhere, customize it to fit your setup (only some basic changes are needed: like the MySQL user and password, backup location), make it executable and activate it in cron as needed (daily for example).

    Check out the FREE project on sourceforge AutoMySQLBackup | Free software downloads at SourceForge.net



    Feel like your Cloud Provider's just weathering the storm? Hop Off the Cloud - The Weathers nicer over here.

Similar Threads & Tags
Similar threads

  1. Backing up MySQL databases on regular schedule
    By GoWilkes in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 11-18-2010, 09:10 PM
  2. Backing Up Root's MySQL Databases
    By triwav in forum Database Discussions
    Replies: 2
    Last Post: 05-18-2010, 07:39 AM
  3. Replies: 4
    Last Post: 07-19-2009, 11:05 AM
  4. WHM backup not backing up all my databases
    By lencionipaolo in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 09-03-2007, 08:08 PM
  5. backing up Databases
    By comptech520 in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 03-17-2006, 10:33 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube