What does tar -cp do?
Hello :)
I cribbed a command intended to make an exact copy of files to another directory Code:
tar cpBf - . | (cd <target directory>; tar xBf -) The source directories (/etc/rc.[0-6S].d in turn) contain symbolic links and an ordinary file. After running the command, the modification times on all the symlinks was reset to the time the tar command was run; the ordinary files had the original modification time. How did that happen?! That's what backups are for :cool: Edit: Code:
c@CW8:~$ tar --version Charles |
Are you just complaining?
You didn't give the exact command that got you into trouble. Did you overwrite the files in the same place? I wonder if you are confusing access time with modification time. If you overwrote the original files then the modification time change makes sense. Otherwise it doesn't. This is how to use tar to copy a directory tree. I use this all the time. Code:
tar c . | tar --directory /destination/dir -xvp Code:
tar --version |
Thanks stress_junkie :)
Quote:
Conventionally, incorrect use of options results in an error so I would regard the reported behaviour as a bug if it is as I presently understand it, especially as I don't expect tar c with any options to change any of the source files' properties except for access time. Thanks for the "heads up" on the --directory option; it is a useful feature. BTW, is it possible to use tar to copy symbolic links without changing their modification time? Best Charles |
All times are GMT -5. The time now is 12:19 PM. |