Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi all! We have been experiencing an issue on site where threads have been missing the latest postings. The platform host Vanilla are working on this issue. A workaround that has been used by some is to navigate back from 1 to 10+ pages to re-sync the thread and this will then show the latest posts. Thanks, Mike.
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

extract tar file to different folder

  • 23-06-2009 3:00pm
    #1
    Registered Users, Registered Users 2 Posts: 169 ✭✭


    hi,
    im trying to get a tar file that was archived on a box with completely different folders structures to extract onto another box with different folders.

    how can i do this?
    can i get tar extract to ignore attempting to create folders, just extract to a specified folder?

    cheers
    db


Comments

  • Closed Accounts Posts: 12,807 ✭✭✭✭Orion


    you can use the '-no-recursion' switch to dump all the files into one directory - is that what you mean?


  • Registered Users, Registered Users 2 Posts: 1,276 ✭✭✭carveone


    hi,
    im trying to get a tar file that was archived on a box with completely different folders structures to extract onto another box with different folders.

    how can i do this?
    can i get tar extract to ignore attempting to create folders, just extract to a specified folder?

    cheers
    db

    Good question. If you mean like pkunzip used to (annoyingly) do by default, that is extract every file in the archive into one directory, I don't believe so. There's no option to do it, even in Gnu tar. You could, however, extract the files first and then write a script to flatten the result...


  • Registered Users, Registered Users 2 Posts: 1,276 ✭✭✭carveone


    Macros42 wrote: »
    you can use the '-no-recursion' switch to dump all the files into one directory - is that what you mean?

    Oh, I thought that switch was only valid with --create. Not in front of a unix machine now so I can't check...


  • Registered Users, Registered Users 2 Posts: 169 ✭✭DonnieBrasco


    Macros42 wrote: »
    you can use the '-no-recursion' switch to dump all the files into one directory - is that what you mean?

    yes - i think !

    3 files within the same directory were tar'd.

    This directory on the new server does not exist and now when trying to un-tar it produces errors because i dont have create directory privs to create the original directory structure.
    So i just want to un-tar to a single specified folder.

    As it happens... i've been able to untar from a windows workstation and just ftp'd the files individually to the folder. so i have now worked around it. im curious tho !

    cheers
    db


  • Closed Accounts Posts: 12,807 ✭✭✭✭Orion


    The man page says nothing about --norecursion being only valid with --create so I'm not sure. However from the sounds of things you could have used sudo or just extracted in your own home directory to get what you want.


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 811 ✭✭✭Rambo


    hi,
    im trying to get a tar file that was archived on a box with completely different folders structures to extract onto another box with different folders.

    how can i do this?
    can i get tar extract to ignore attempting to create folders, just extract to a specified folder?

    cheers
    db

    have you tried using ark --extract-to

    http://manpages.ubuntu.com/manpages/gutsy/man1/ark.1.html


  • Registered Users, Registered Users 2 Posts: 432 ✭✭Catch_22


    just chroot the tar extract to some folder and then you can do what you like with the resulting files.


  • Registered Users, Registered Users 2 Posts: 3,721 ✭✭✭E39MSport


    Catch_22 wrote: »
    just chroot the tar extract to some folder and then you can do what you like with the resulting files.

    Nice !


Advertisement