Find the answer to your Linux question:
Results 1 to 3 of 3
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    Shell script backup problem.

    When i try to create a backup i am getting an error that says "tar: cowardly refusing to create an empty archive". If anyone can help i would be very appreciative.

    clear #clears all other commands
       echo "-----------------------------------------"
       echo " **************Main Menu*****************"
       echo "-----------------------------------------"
       echo "Choose an option"
       echo "[A]Backup"
       echo "[B]Restore"
       echo "[C]Quit"
       echo "-----------------------------------------"
       read option
       case "$option" in
       "A" | "a" )  
       read -p "name your backup : " tarball
       read -p "Directory to back up: " bckdir
       tar -cf $tarball $backdir
       "B" | "b" )
       read -p "Name of restore file: " tarball
       tar -xf $tarball
        "C" | "c" )
        echo "Exiting......"
    *) echo "Please press a letter between A to C" ;;

  2. #2
    Penguin of trust elija's Avatar
    Join Date
    Jul 2004
    Either at home or at work or down the pub
    Looks like a typo in a variable name. bckdir or backdir?
    Should you be sitting wondering,
    Which Batman is the best,
    There's only one true answer my friend,
    It's Adam Bloody West!

    The Fifth Continent

  3. #3
    Thanks, that fixed the problem perfectly =)

  4. $spacer_open

Posting Permissions

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