i need help with the cp command (oracle linux 4.0)
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,
|