LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   making a full backup (https://www.linuxquestions.org/questions/linux-general-1/making-a-full-backup-749238/)

mia_tech 08-21-2009 04:17 AM

making a full backup
 
guys, I'm using this tar command in order to make a full backu, but for some reason is not completing... "it hangs"

Code:

tar -zcvpf /mnt/backup/fullbackup.tar.gz / --exclude=mnt/backup > /home/user/backup.log
I know there are open files by the system, and therfore, I've tried to use --exclude=dev --exclude=proc, and other folder that I think the system might be using, but still same results. Would you mind sharing some of the command you use for making full backups?

jschiwal 08-21-2009 06:12 AM

Don't backup /proc, /tmp, /sys, /var/tmp, /mnt, /dev or /media. /proc and /sys files are generated on the fly by the kernel. The /dev directory is created when you boot, and changes are made by udev as you run. /tmp is not important and often cleared when you reboot. /mnt contains filesystems you mount, often large external drives. /media is for removable media that is auto mounted.
(directories under /mnt you might want to backup, but on a case by case basis, as in an internal hard drive mounted there)

Be sure to scan through the tar info manual. Do you use file attributes that tar doesn't backup?
It may depend on your version of tar, and which attributes you need backed up. E.G. se-linux or posix capabilities.

Read the section on dumps. The -g option may be useful for producing incremental backups.

I'm betting that the hangup is due to trying to backup /proc, which will generate a core image of your entire system. You may have a have circular link somewhere.

Lee_Ball 08-21-2009 06:15 AM

Are you also backing up the other files and folders in /mnt? if not exclude the whole directory.

tar -zcvpf /mnt/backup/fullbackup.tar.gz --exclude=/proc --exclude=/lost+found --exclude=/mnt --exclude=/sys / > /home/user/backup.log


Try that, also, what does the backup.log file stop at?

mia_tech 08-23-2009 04:14 PM

Quote:

Originally Posted by Lee_Ball (Post 3652210)
Are you also backing up the other files and folders in /mnt? if not exclude the whole directory.

tar -zcvpf /mnt/backup/fullbackup.tar.gz --exclude=/proc --exclude=/lost+found --exclude=/mnt --exclude=/sys / > /home/user/backup.log


Try that, also, what does the backup.log file stop at?

the backu stops at the /srv forlder... it won't continue!

Lee_Ball 08-28-2009 04:39 AM

To check if it really has stopped you can check the size of the backup file by doing this:

Code:

watch ls -l /mnt/backup/fullbackup.tar.gz
That should tell you the size of it every 2 seconds, if its not increasing when its stopped, then yes, it may have stopped.

If that is the case see what happens by excluding the /srv folder


Code:

tar -zcvpf /mnt/backup/fullbackup.tar.gz --exclude=/srv --exclude=/proc --exclude=/lost+found --exclude=/mnt --exclude=/sys / > /home/user/backup.log

mia_tech 08-29-2009 02:21 AM

nahh, I gave up on tar. I started using dump which gets the backup done pretty fast. I'm talking about 7 Gigs of space down to 1.5 Gig in about 20 min...

RaptorX 08-29-2009 03:02 PM

Quote:

Originally Posted by mia_tech (Post 3661673)
nahh, I gave up on tar. I started using dump which gets the backup done pretty fast. I'm talking about 7 Gigs of space down to 1.5 Gig in about 20 min...

I am interested on this... how are you using the dump command to achieve this?

mia_tech 08-30-2009 02:22 AM

full backup with dump

dump -0aj -f /mnt/storage/backup/home.bak /home/user

here's a good link to get your feet wet with dump.... I'm still getting to know the command, but I think one of the best functionality is the built in options of making full, incremental, and differential backups

http://surf.ap.seikei.ac.jp/~nakano/...-HOWTO.en.html

RaptorX 09-03-2009 06:12 AM

thanks it works perfectly!


All times are GMT -5. The time now is 02:38 PM.