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 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

tar

  • 09-06-2008 2:29pm
    #1
    Registered Users, Registered Users 2 Posts: 26,584 ✭✭✭✭


    how do i crate a tar of a directory and all it's sub directories except for a sub-directory called backup?

    i created the tar like so tar cvf tool.tar tool

    the backup directory is inside tool but i don't want it included in the tar.


Comments

  • Closed Accounts Posts: 413 ✭✭sobriquet


    There's an --exclude=/path/to/directory option, check the man page for details. So backing up my home dir goes something like: `tar -cvf home-backup.tar /home/foo --exclude=/home/foo/backups` - on Windows at the mo so can't check.


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


    Cremo wrote: »
    how do i crate a tar of a directory and all it's sub directories except for a sub-directory called backup?

    i created the tar like so tar cvf tool.tar tool

    the backup directory is inside tool but i don't want it included in the tar.


    tar -cf tool.tar --exclude backup tool

    ok


  • Closed Accounts Posts: 7,563 ✭✭✭leeroybrown


    One point to note is that this will all work easily with GNU tar but the options can vary when using Unix tar variants.


  • Registered Users, Registered Users 2 Posts: 26,584 ✭✭✭✭Creamy Goodness


    One point to note is that this will all work easily with GNU tar but the options can vary when using Unix tar variants.
    i'm not too sure what version of tar i have, since i'm no where near the machine at the moment i can't check, but it's a solaris 8 machine.


  • Closed Accounts Posts: 7,563 ✭✭✭leeroybrown


    If it's Solaris 8 without the GNU utilities being explicitly installed then the options will be somewhat different. Offhand the following might work with Solaris tar:
    tar cfX tool.tar exclude.file tool
    

    where exclude.file is the name of a file that contains the string:
    tool/backup
    

    It might need to be preceded with "./" to get an exact string match if tar is being particularly anal.

    Check the local man page to see if this seems ok for your variant.


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 26,584 ✭✭✭✭Creamy Goodness


    perfect got it to work, cheers leeroy.


Advertisement