Find the answer to your Linux question:
Results 1 to 3 of 3
I have folder called .temp in Code: /backups/full/user/.temp I have the script which puts database backups and home directory backup(.tar.gz) in that .temp folder. Now from those two backups i ...
  1. #1
    Just Joined!
    Join Date
    Aug 2009
    Posts
    15

    how to create tar file without folders

    I have folder called .temp in



    Code:
    /backups/full/user/.temp
    I have the script which puts database backups and home directory backup(.tar.gz) in that .temp folder.


    Now from those two backups i want to create a third full.tar file which will contain those two backups.


    The problem is if i use


    Code:
    tar -cf full.tar /backups/full/user/.temp/*
    then when i extract my archive , then i have the following directory structure

    I got all the folder above like



    Code:
    folder bakcups -->full -->user-->.temp and then the backups
    Is there any way that my tar file only contain files in .temp and not all the folders.

  2. #2
    Linux Newbie
    Join Date
    Mar 2009
    Posts
    228
    Try this:

    Code:
    tar -C /backups/full/user/.temp -cf full.tar .

  3. #3
    Just Joined!
    Join Date
    Aug 2009
    Posts
    15
    Actually i was using coomand

    su -c "tar -C /backups/full/user/.temp -cf full.tar ." - username
    the problem is su removes the first slash and wants to find relative path bit i want to use absolute path.

    Is there any solutions for this

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...