DB Back Up

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • GSXR
    New Member
    • Aug 2008
    • 24
    • 3.6.x

    DB Back Up

    I want to back my DB`s up the correct way but I`m a bit of a tool so I have some questions........

    Goal is to figure out backing up using Cron.

    This one is just a small forum that I use for as a personal online catolouge for my real job.......The main forum has a DB of about 1Gig, hence I want to get it right.

    Ive figured this much out..I`m using SSH with Putty.

    mysqldump --opt -Q -u dbusername -p databasename > backupname.sql

    That backs the DB up to the root diectory, right?

    I`m figuring that....
    mysqldump --opt -Q -u dbusername -p databasename > /path/to/backupname.sql

    will take it to a specfic directory.....say.....backups.

    My problem is I don't know what /path/to/............means

    Can someone tell me what that means
    I think possibly /path=site name and /to means the directory you want to put it in......namely backups

    Like I said the goal is to Cron the backups daily but if I don`t understand this part properly I`m no hope to achieve that

    Can someone point me in the right direction.
  • GSXR
    New Member
    • Aug 2008
    • 24
    • 3.6.x

    #2
    Got it.
    PATH=HOME/TO=LOGIN NAME/then create directory called whatever/xxxx.sql

    Comment

    • Floris
      Senior Member
      • Dec 2001
      • 37767

      #3
      Inside the shell you login to your home dir, like: /
      inside that you have your public_html, for example: /public_html

      From the shell when you type: pwd

      You get the full path, like: /home/login/public_html/

      If you make a new dir called, backups like this: mkdir backups
      then change dir into it: cd backups
      and type: pwd

      You will get something like: /home/login/backups/

      You can now use this in the export query.

      Comment

      • GSXR
        New Member
        • Aug 2008
        • 24
        • 3.6.x

        #4
        Thanks for that Floris....

        I Dis did the cron......The DB backup ended in in the directory I wanted it to but it was 0Kb ......just a blank file called xxxxxx.sql.......any clues?

        Comment

        • Hayk
          Senior Member
          • Sep 2007
          • 504
          • 5.2.x

          #5
          Any clue is to try again

          As you wrote:

          mysqldump --opt -Q -u dbusername -p databasename > backupname.sql
          vBProjects - Professional vBulletin Services and Solutions
          vBSpring - Premium vBulletin Add-ons

          Comment

          • Floris
            Senior Member
            • Dec 2001
            • 37767

            #6
            You have to do that different, without password, it will just idle on 'waiting for pass' or 'tried a enter as a pass and didn't work'.

            so do it like this, with -p and without a space add the pass , like .. if pass was qwerty123 then do -pqwerty123

            Comment

            • GSXR
              New Member
              • Aug 2008
              • 24
              • 3.6.x

              #7
              Got the data base cron working.

              This worked

              mysqldump --opt -Q -u xxxxxx_xxxxxx --password=xxxxxx xxxxxxxx> /home/backup/xxxxxx.sql

              Hopefully someone as frustrated as me finds this thread an is encouraged not to give up. If I can do this, anyone can.

              Thanks Floris, Thanks Hayk.

              Comment

              widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
              Working...