Google
 

2/7/07

Backup data under linux.

We just got the 500G external hard drive. The task is to backup the data in the linux system, mainly the research data.
First tried the following scripts:

#!/bin/bash
CurDate=`date +"%m%d%y"`
tar --verify -cf /media/usbdisk2/username/linuxbk/home_$CurDate.monthlyfull.tar /home/username/

However, there was an error, saying that "8811 File size limit exceeded". Then I searched the website and find the following solution by using split.

#!/bin/bash
CurDate=`date +"%m%d%y"`
tar cPf - /home/username/|(cd /media/usbdisk2/username/linuxbk/; split --verbose --bytes=1000m - home_$CurDate.monthlyfull.tar)

Here I split the cells by 1 G. This does work and there is no error on this. Now the question is how to recover this if necessary.

cat /media/usbdisk2/username/linuxbk/home_$CurDate.monthlyfull.tar* | tar xvf - {/home/{{dirs}/files}}

"You can cat from anywhere since you used the "P" tar option which preserves the root "? Here maybe it is better not to use "P" option, because that may overwrite the username home directory when restore it.


No comments: