06-08-2007
1,
0
Join Date: Jun 2007
Last Activity: 3 October 2007, 4:27 AM EDT
Location: Norway
Posts: 1
Thanks Given: 0
Thanked 0 Times in 0 Posts
I need help with the cp command (Oracle Linux 4.0)
Hi,
I use the cp command a lot to take quick disk backups of my Oracle Homes before a patch. However, am a bit confused about the options you can use with the cp command. I have always used the cp -R, but now I have tried out a few different commands on an Oracle Home, and I have not got the results I expected.
The Oracle Home am backing up has a size of 57.7GB, an it has 106911 files, and 11079 sub-folders. I have always believed that the -R option is the correct one to use because that one will copy the special files just the way they are, like symbolic links, and you should get a backup of the same size as the original. While, if using the -r option, the backup will follow the symbolic link and copy the file or folder again, instead of backing up the symbolic link as it is, and then you will get a backup of a bigger size than the original.
So I tried it out on my Oracle Home (all the backups were of a slightly different size, but only a few bytes):
1) cp -r -> 67.9GB 626851 files and 44013 sub-folders
2) cp -R -> 67.9GB 626852 files and 44013 sub-folders
3) cp -Rl -> 67.9GB 626852 files and 44013 sub-folders
4) cp -RL -> 67.9GB 626852 files and 44013 sub-folders
5) cp -a -> 67.9GB 626852 files and 44013 sub-folders
The original is 57.7GB 106911 files and 11079 sub-folders
As you can see, no matter what option of the cp command I used, the size of the backups were the same, and they all are bigger in size, and have more files and folders than the original Oracle Home. Why is that? Can I trust this backup? And what command should I use to be sure that I have a backup exactly the same as the original?
To find the size, number of files and folders I right clicked the folder and chose 'Properties', just like in a Windows environment.
I would appreciate some feed back on this.
Thank you:-)
Regards,
Anne