Sponsored Content
Full Discussion: Backup and restore using tar
Operating Systems Linux Red Hat Backup and restore using tar Post 302758987 by Tommyk on Monday 21st of January 2013 06:47:29 AM
Old 01-21-2013
Backup and restore using tar

This will be covered elsewhere im sure but i just cant seem to find my exact issue.

I want to backup my systems using tar, command is:

Code:
tar -cjpf /backup /bin /etc /home /opt /root /sbin /usr /var /boot

When i include the / directory it also tar's the /lib /sys /proc /dev filesystems too (and more but these seem to be problem directories.)

Although i have never tried to restore the /sys /proc and /dev directories I have not seen anyone mention that your cant restore /lib but when i tried the server crashed and would not even start the kernel (not even in single user mode).

Can anyone let me know why this happened and provide a more comprehensive list of directories than the 4 mentioned as to what should and shouldn't be backed up and restored? Or point me to a useful site that might explain why you should or shouldn't backup each one?
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Cannot restore a TAR backup

I backed up a unix database using "tar -cvf /dev/rmt1 -N 800 /*" Normally I would restore this using "tar -xvf /dev/rmt1 -N 800" This is reporting an error about "not enough memory" I have done a new test backup and restore using the same commands and they work. ANY IDEAS ? (2 Replies)
Discussion started by: Ross.Goodman
2 Replies

2. Solaris

tar - restore a file

We use tar for backing up a server. I need to restore just one file from this backup. Anyone know the syntax? (2 Replies)
Discussion started by: frustrated1
2 Replies

3. UNIX for Dummies Questions & Answers

Question regarding tar restore

I created a relative backup of my home directory using tar into a file named backup.tar. No problem there. I checked it out using the table of contents command to list the contents of the backup.tar file, and there is no problem there either. But, when I tried restoring backup.tar into a... (2 Replies)
Discussion started by: Relykk
2 Replies

4. Solaris

Backup / restore

Hi.... everyone could help me to understand how to do a backup of my servers .. operating systems is sun solaris 8 . I have some question about .... 1) Is better backup phisical disk or partition ??? i sow the command is ufsdump 0cfu /expbck/bcksunver/c0t0d0s5 dev/dsk/c0t0d0s5 to... (4 Replies)
Discussion started by: tt155
4 Replies

5. AIX

Backup and restore

I have several H80 machines, all with AIX 4.3.3. On these machines I have mksysb running for rootvg backups and savevg for non-rootvg backups. I'm trying to get a list of files on the tapes, but I can't seem to do it with tar for the mksysb images. I keep getting the directory checksum errors?... (3 Replies)
Discussion started by: uXion
3 Replies

6. HP-UX

F-Backup restore

Hello! i have a blank harddrive and a complete tape backup of the workstation. the backup is made with F-Backup. Now my question is: how can i restore my workstation? thanks for every idea! paul tittel hup-si (3 Replies)
Discussion started by: paultittel
3 Replies

7. UNIX for Dummies Questions & Answers

Restore files with TAR -- Help

Hi, Can anyone tell me the right TAR command to restore all the files dirs/subdirs/files etc. to a given directory on my hdd from a TAPE drive? I already used the list function to see that there is data on it with this commando: # tar tf /dev/st0 Now I need to copy all the data to a... (1 Reply)
Discussion started by: severt
1 Replies

8. Shell Programming and Scripting

Backup/restore scripts

hi people i am in need of some assistance here hoping to star a linux course in january to wanted to get some experiance before starting so got a hold of some old assessments from a mate at college so just working through them in my spare time for the past 8 weeks or so and this is the final ? that... (2 Replies)
Discussion started by: boabbyrab
2 Replies

9. AIX

Backup and restore

Hi experts, i got a question. i have a production server with two Volume Group(VG) which are rootvg and datavg. Both of these VGs are 256 PP SIZE. On Disaster Recovery Server (DR server) contains two empty hardisks for restoring rootvg and datavg from production server. This two hardisks are... (7 Replies)
Discussion started by: polar
7 Replies

10. Red Hat

Backup / Restore

Hi, I need to back up a RH file system (96G). The files are oracle .dbf format some of which are 5G in size. I know that tar has got a size restriction of 2G so I cannot use this. Can anyone recommend an alternative way of backuping up this FS? I have been looking at dump but this... (6 Replies)
Discussion started by: Duffs22
6 Replies
FSVS - Backup HOWTO(5)						       fsvs						    FSVS - Backup HOWTO(5)

NAME
HOWTO: Backup - This document is a step-by-step explanation how to do backups using FSVS. This document is a step-by-step explanation how to do backups using FSVS. Preparation If you're going to back up your system, you have to decide what you want to have stored in your backup, and what should be left out. Depending on your system usage and environment you first have to decide: o Do you only want to backup your data in /home? o Less storage requirements o In case of hardware crash the OS must be set up again o Do you want to keep track of your configuration in /etc? o Very small storage overhead o Not much use for backup/restore, but shows what has been changed o Or do you want to backup your whole installation, from / on? o Whole system versioned, restore is only a few commands o Much more storage space needed - typically you'd need at least a few GB free space. The next few moments should be spent thinking about the storage space for the repository - will it be on the system harddisk, a secondary or an external harddisk, or even off-site? Note: If you just created a fresh repository, you probably should create the 'default' directory structure for subversion - trunk, branches, tags; this layout might be useful for your backups. The URL you'd use in fsvs would go to trunk. Possibly you'll have to take the available bandwidth into your considerations; a single home directory may be backed up on a 56k modem, but a complete system installation would likely need at least some kind of DSL or LAN. Note: If this is a production box with sparse, small changes, you could take the initial backup on a local harddisk, transfer the directory with some media to the target machine, and switch the URLs. A fair bit of time should go to a small investigation which file patterns and paths you not want to back-up. o Backup files like *.bak, *~, *.tmp, and similar o History files: .sh-history and similar in the home-directories o Cache directories: your favourite browser might store many MB of cached data in you home-directories o Virtual system directories, like /proc and /sys, /dev/shmfs. Telling FSVS what to do Given $WC as the working directory - the base of the data you'd like backed up (/, /home), and $URL as a valid subversion URL to your (already created) repository path. Independent of all these details the first steps look like these: cd $WC fsvs urls $URL Now you have to say what should be ignored - that'll differ depending on your needs/wishes. fsvs ignore './**~' './**.tmp' './**.bak' fsvs ignore ./proc/ ./sys/ ./tmp/ fsvs ignore ./var/tmp/ ./var/spool/lpd/ fsvs ignore './var/log/*.gz' fsvs ignore ./var/run/ /dev/pts/ fsvs ignore './etc/*.dpkg-dist' './etc/*.dpkg-new' fsvs ignore './etc/*.dpkg-old' './etc/*.dpkg-bak' Note: /var/run is for transient files; I've heard reports that reverting files there can cause problems with running programs. Similar for /dev/pts - if that's a devpts filesystem, you'll run into problems on update or revert - as FSVS won't be allowed to create entries in this directory. Now you may find that you'd like to have some files encrypted in your backup - like /etc/shadow, or your .ssh/id_* files. So you tell fsvs to en/decrypt these files: fsvs propset fsvs:commit-pipe 'gpg -er {your backup key}' /etc/shadow /etc/gshadow fsvs propset fsvs:update-pipe 'gpg -d' /etc/shadow /etc/gshadow Note: This are just examples. You'll probably have to exclude some other paths and patterns from your backup, and mark some others as to-be- filtered. The first backup fsvs commit -m 'First commit.' That's all there is to it! Further use and maintenance The further usage is more or less the commit command from the last section. When do you have to do some manual work? o When ignore patterns change. o New filesystems that should be ignored, or would be ignored but shouldn't o You find that your favorite word-processor leaves many *.segv files behind, and similar things o If you get an error message from fsvs, check the arguments and retry. In desperate cases (or just because it's quicker than debugging yourself) ask on dev [at] fsvs.tigris.org. Restoration in a working system Depending on the circumstances you can take different ways to restore data from your repository. o 'fsvs export' allows you to just dump some repository data into your filesystem - eg. into a temporary directory to sort things out. o Using 'fsvs revert' you can get older revisions of a given file, directory or directory tree inplace. o Or you can do a fresh checkout - set an URL in an (empty) directory, and update to the needed revision. o If everything else fails (no backup media with fsvs on it), you can use subversion commands (eg. export) to restore needed parts, and update the rest with fsvs. Recovery for a non-booting system In case of a real emergency, when your harddisks crashed or your filesystem was eaten and you have to re-partition or re-format, you should get your system working again by o booting from a knoppix or some other Live-CD (with FSVS on it), o partition/format as needed, o mount your harddisk partitions below eg. /mnt, o and then recovering by $ cd /mnt $ export FSVS_CONF=/etc/fsvs # if non-standard $ export FSVS_WAA=/var/spool/fsvs # if non-standard $ fsvs checkout -o softroot=/mnt If somebody asks really nice I'd possibly even create a recovery command that deduces the softroot parameter from the current working directory. For more information please take a look at Using an alternate root directory. Feedback If you've got any questions, ideas, wishes or other feedback, please tell us in the mailing list users [at] fsvs.tigris.org. Thank you! Author Generated automatically by Doxygen for fsvs from the source code. Version trunk:2424 11 Mar 2010 FSVS - Backup HOWTO(5)
All times are GMT -4. The time now is 10:08 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy