AIX

AIX

Connect with fellow AIX users and experts to gain knowledge, share insights, and solve problems.

 View Only
  • 1.  Remote command

    Posted Fri October 05, 2007 12:18 PM

    Originally posted by: SystemAdmin


    Hello,

    I run the following command on serverA and I want the action on ServerB. Is there anything wrong with the follwoing command?

    root@ServerA /> ssh root@ServerB tar -xvf /installedApps/static/myfile.tar

    When I run the command, it looks that it is untaring without any error. But when I logon to ServerB and check the date, still showing
    the old date.

    Thanks


  • 2.  Re: Remote command

    Posted Fri October 05, 2007 12:23 PM

    Originally posted by: orphy


    Try "-xvpf".
    Orphy


  • 3.  Re: Remote command

    Posted Fri October 05, 2007 01:42 PM

    Originally posted by: SystemAdmin


    Tried it but did not work. Still have the old timestamp.


  • 4.  Re: Remote command

    Posted Fri October 05, 2007 02:43 PM

    Originally posted by: orphy


    Maybe I misunderstood your question. What did you mean by old timestamp?
    The file timestamp of the files within the tar or timestamp you don't
    expect to see? When you restore with -xvpf, you should have the files
    restored with the file timestamps in the tar file. Maybe you can give
    us an example?
    Orphy


  • 5.  Re: Remote command

    Posted Sat October 06, 2007 12:22 PM

    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


  • 6.  Re: Remote command

    Posted Wed October 10, 2007 05:53 PM

    Originally posted by: SystemAdmin


    Thanks alot Sri, I think I know what I am doing wrong here.
    Can you also tell me if I can these two lines in one line.

    5) cd /var/tmp
    6) tar xvf /tmp/lll.tar
    something like "tar xvf source.tar destinatio_directory"

    I have tried this but it seems to be wrong.
    tar xvf /tmp/lll.tar /var/tmp