LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Backup entire system with tar (https://www.linuxquestions.org/questions/linux-general-1/backup-entire-system-with-tar-176181/)

sln 04-29-2004 10:52 PM

Backup entire system with tar
 
I want to do a complete backup of a linux box "everything" in case an upgrade doesn't work. This box only has a cdrom, floppy and harddrive with the following capacity:
[root@linuxcracy]# df -ah
Falsest Size Used Avail Use% Mounted on
/dev/hda5 4.4G 1.7G 2.5G 39% /
none 0 0 0 - /proc
/dev/hda1 53M 34M 17M 66% /boot
none 251M 0 251M 0% /dev/shm
none 0 0 0 - /dev/pts

I was going to use a tar command but what should I use "tar -cvxf TheWholeThing.tar.gz /". Please make a suggestion and do I have enough space? I would then sftp the tarfile to a different computer. Do you have a different suggestion.

Does anyone have a good tar script to will tar everything.

Thanks:
Steve
:confused:

bigrigdriver 04-30-2004 12:52 AM

For backups, you probably want to exclude directories such as /proc, /mnt, and /lost+found. /proc is for currently running processes; /mnt is for mount points which you can recreate easily; and lost+found is for things fsck found which it can't put back in place and you have to do it manually. You don't really need to backup anything which you have on the distro's installation cd's. It it breaks, you can reinstall. If you downloaded anything, and kept the file you downloaded in an archive, backup that archive, and use it the same as you would an install cd. If you did not keep it in an archive, then you will have to determine where all the pieces are and backup the appropriate directories. The things that really need backup are /etc (all your configs), /home, and any data directories or partitions you have set up.
To use tar, study the man pages or info pages carefully. Select the options which apply to your situation. If you know enough about tar, construct include and exclude text files to use with the appropriate tar options, it will simplify how much you have to type on the command line.
Above all, do a google search on 'backup script' or some such keyword search. There are numerous scripts you can download to study to see if they suit your needs.

MS3FGX 04-30-2004 03:32 AM

You are also going to want to leave out /dev.

Not that it is particularly large, but they are all generic anyway (unless you make any changes to /dev).


All times are GMT -5. The time now is 07:25 PM.