Originally posted by: murthys
I would request you isolate the tar and ssh part from this question you have. We just need to analyze how tar works and then we can
tar command is tape achieve command that does not alter the date of the file when extracted from the . The -p flag is capable of overriding the umask of the shell and it will not alter the date of the file either. One of the ways you can determine if the file was created on a different date is by looking at the attributes in istat on the file.
Please try this experiment to get clarity on what I am trying to say here:
1) touch /tmp/lll
2) istat /tmp/lll
3) cd /tmp/
4) tar cvpf /tmp/lll.tar ./lll
5) cd /var/tmp
6) tar xvf /tmp/lll.tar
7) istat /var/tmp/lll
You will see that the "Last updated:" and "Last accessed:" attributes are different while the "Last modified:" attribute will be same for both /tmp/lll and /var/tmp/lll (ls command uses that attribute the date filed of the file listing)
I hope I have explained what is happening here clearly and if you should have any more questions, please do not hesitate to post it here.
Sri