Tips for Backup and Restore in Linux . . . . - Sarath

Sarath

  • Embedded
  • Linux
  • Android
  • OpenSource

Post Top Ad

Saturday 23 March 2013

Tips for Backup and Restore in Linux . . . .

1. Before you backup your system, be specific of what type of data to backup, (Is it a Full or an Incremental or a Differential Backup?), where to backup (Flash drive, Hard-disk, Over Network) and what to Backup (just the home folder or the root itself).

2. To list all files in an archive file,
 
1# tar -tvf archive.tar
 
3. You need to verify that the backup made can be restored because once the data is removed, your backup cannot be restored, and then you can only be sorry.
To check if your backup process is working properly, use –compare (-d) option
 
1# tar --compare --verbose -f backup.tar.gz
 
4. If your backup needs more than one tape, you need to use the –multi-volume (-M ) option
 
1# tar  -cMF  /dev/fd0H1440  /home/rabi/
 
5. Incremental dumps depend crucially on time stamps, the results are unreliable if you modify a file’s time stamps during dumping (e.g., with the ‘–atime-preserve=replace’ option), or if you set the clock backwards.
 
6. Be sure of the order in which you are extracting incremental backup because GNU tar tries to restore the exact state of the file system when the archive was created. Therefore, it will delete those file that did not exist when the archive was created.
 
7. Backup over a Network
(a) Using Netcat
 
1# nc –l  1024 > backup.tar.gz
 
The choice of port is entirely up to the user, as long as it is 1024 or larger
 
- In Sending Computer, type
 
1# tar -cvpz <all those other options like above> / | nc -q 0 <receiving host> 1024
In  <receiving host> replace with the name of the computer on the network.
(b) Using SSH
 
1# tar -cvpz <all those other options like above> / | ssh <backuphost> "( cat > ssh_backup.tar.gz )"
ssh_backup.tar.gz Is the name of the file that will be created on the machine indicated.
<backuphost> – Should be replaced with the name of the computer in question on the network.
 
8. Restore over a Network
 
1# nc -l 1024 | tar -xvpjf - -C /mnt/disk
You need to mount the disk before executing this command.
 
Sending Computer
 
. . .# cat backup.tar.gz | nc -q 0  1024
 
 
 



 

No comments:

Post a Comment