Find the answer to your Linux question:
Results 1 to 6 of 6
Quick question, does tar not recognize .sql files? I am trying to tar a directory that just has a backup of my sql database in it and I'm getting this ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Aug 2011
    Posts
    11

    Quick question: does tar not recognize .sql files?


    Quick question, does tar not recognize .sql files? I am trying to tar a directory that just has a backup of my sql database in it and I'm getting this message: tar: Cowardly refusing to create an empty archive

    Anyway to get tar to realize the archive wont be empty?

  2. #2
    Trusted Penguin Irithori's Avatar
    Join Date
    May 2009
    Location
    Munich
    Posts
    3,444
    tar will work on any file, even special ones like device files.
    You need to be sure, that the files are consistent while creating the tarball, though.

    The error message indicates wrong usage.
    You must always face the curtain with a bow.

  3. #3
    Linux Guru Cabhan's Avatar
    Join Date
    Jan 2005
    Location
    Seattle, WA, USA
    Posts
    3,252
    Can you show us the tar command that you're running? As Irithori says, tar works on all files.

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Engineer hazel's Avatar
    Join Date
    May 2004
    Location
    Harrow, UK
    Posts
    1,281
    Quote Originally Posted by erinod View Post
    I am trying to tar a directory that just has a backup of my sql database in it and I'm getting this message: tar: Cowardly refusing to create an empty archive

    Anyway to get tar to realize the archive wont be empty?
    You need to give tar a filename to use for the archive as well as naming the directories or files to go into it:
    tar -cf sql.tar path/to/sql/directory
    "I'm just a little old lady; don't try to dazzle me with jargon!"
    www.hrussman.entadsl.com

  6. #5
    Linux Enthusiast sgosnell's Avatar
    Join Date
    Oct 2010
    Location
    Baja Oklahoma
    Posts
    507
    If you're using GNU tar, and you probably are, the tutorial for it is here. It's worth a read.

  7. #6
    Just Joined!
    Join Date
    Aug 2011
    Posts
    11
    thanks guys, i didnt have the "-" for the parameters in the right place, thats why it was creating an empty tar file.

Posting Permissions

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