Find the answer to your Linux question:
Results 1 to 2 of 2
I need a little help with the dump/restore utility. The system is a small Centos 6.4 system at a client of mine that hosts a MySql db. The dumps are ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Sep 2013
    Posts
    1

    Issues with Dump utility...


    I need a little help with the dump/restore utility. The system is a small Centos 6.4 system at a client of mine that hosts a MySql db. The dumps are done to a USB stick and then sync'd to my office offsite. There is a daily cron task that does the incremental dumps:

    Code:
    [##### cron.daily]# cat backupdaily
    #! /bin/sh
    ymd=`date +%Y%m%d`
    dom=`date +%-e`
    mysqldump --all-databases --events --password="}/p<inY6" > /mysqldump/mysql.sql
    backuppath='/BackupUSB/'$ymd'root'
    cmdstr='dump -'$dom'u -f '$backuppath' /'
    `$cmdstr`
    backuppath='/BackupUSB/'$ymd'boot'
    cmdstr='dump -'$dom'u -f '$backuppath' /boot'
    `$cmdstr`
    df
    Also, there's a monthly cron task that does the full dumps:
    Code:
    [##### cron.monthly]# cat backupmonthly
    #! /bin/sh
    ymd=`date +%Y%m%d`
    dom=`date +%-e`
    backuppath='/BackupUSB/'$ymd'rootfull'
    cmdstr='dump -0u -f '$backuppath' /'
    `$cmdstr`
    backuppath='/BackupUSB/'$ymd'bootfull'
    cmdstr='dump -0u -f '$backuppath' /boot'
    `$cmdstr`
    I have one issue and one general question. First, for some reason I cannot explain, the full dumps run twice a month, once on the 1st and then again on either the 19th or 20th of the month. I have dug around at cron tasks, running processes and cannot for the life of me see why this second one runs. The second problem is a bit embarrassing - I wanted to restore some items from this system to a development system I have and cannot seem to follow the posts I have found to get it done, mostly because they are tape based examples. If someone can point me to an example of restoring from a backup set on a disk volume, I would much appreciate.
    Last edited by atreyu; 10-01-2013 at 11:12 PM. Reason: added CODE tags to aid in readability

  2. #2
    Trusted Penguin
    Join Date
    May 2011
    Posts
    4,353
    Quote Originally Posted by claygoss View Post
    First, for some reason I cannot explain, the full dumps run twice a month, once on the 1st and then again on either the 19th or 20th of the month. I have dug around at cron tasks, running processes and cannot for the life of me see why this second one runs.
    can you show the cronjob that runs this dump? are you sure no other crons exist that might be calling it? look in all these files:
    Code:
    find /etc/cron* /var/spool/cron/ -type f

    The second problem is a bit embarrassing - I wanted to restore some items from this system to a development system I have and cannot seem to follow the posts I have found to get it done, mostly because they are tape based examples. If someone can point me to an example of restoring from a backup set on a disk volume, I would much appreciate.
    what have you tried? Here is a primitive example. as root:

    Code:
    # dump -L testdump -f /tmp/test.dmp /var/www/cgi-bin/
    (prints a bunch of output and creates the file /tmp/test.dmp)

    view the dump contents:
    Code:
    # restore -t -f /tmp/test.dmp 
    Dump   date: Thu Oct  3 02:08:59 2013
    Dumped from: the epoch
    Level 0 dump of / (dir var/www/cgi-bin/test) on localhost:/dev/sda1
    Label: testdump
             2      .
        130306      ./var
        131079      ./var/www
        147182      ./var/www/cgi-bin
        146593      ./var/www/cgi-bin/test
        135444      ./var/www/cgi-bin/test/script.cgi
    if you're sure, you can restore with :

    Code:
    restore rf /tmp/test.dmp
    note that it will write to the current dir, so if you are in /root, it would create:

    Code:
    /root/var/www/cgi-bin/test/script.cgi
    more on dump and restore here.

    Note that this could be very dangerous! you could overwrite data so be careful with the restore command!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •