Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > Fedora 17/18 > Using Fedora
FedoraForum Search

Forgot Password? Join Us!

Using Fedora General support for current versions. Ask questions about Fedora and it's software that do not belong in any other forum.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 24th March 2012, 03:53 PM
glennzo's Avatar
glennzo Online
Un-Retired Administrator
 
Join Date: Mar 2004
Location: Salem, Mass USA
Posts: 13,930
linuxchrome
What's wrong with this tar command?

Run from a script
PHP Code:
tar -czvf $BACKUP_DIR/$BACKUP_NAME 
I get the following greeting:

PHP Code:
tarYou may not specify more than one `-Acdtrux' or `--test-label' option
Try `tar --help' 
or `tar --usage' for more information. 
In the script ...
PHP Code:
BACKUP_DIR="/mnt/disk3/backup"
BACKUP_NAME="scripts-`date +%Y%m%d`.tar.gz" 
__________________
Glenn
The Bassinator © ®


Laptop: Toshiba Satellite / Intel Core 2 Duo 1.73 GHz / 2GB / 160GB / Intel Mobile 945GM/GMS/GME/943/940GML Integrated Graphics
Desktop: BioStar MCP6PB M2+ / AMD Phenom 9750 Quad Core / 4GB / 1TB SATA / 500GB SATA / EVGA GeForce 8400 GS 1GB
Reply With Quote
  #2  
Old 24th March 2012, 03:58 PM
Adunaic's Avatar
Adunaic Offline
Registered User
 
Join Date: Mar 2009
Location: Lancaster, UK
Posts: 883
linuxfirefox
Re: What's wrong with this tar command?

Nothing that I can tell. It works on mine with

I set the variables to have the same name as yours as well. Perhaps it is a file in the dir it does not like?

Last edited by Adunaic; 24th March 2012 at 04:01 PM.
Reply With Quote
  #3  
Old 24th March 2012, 04:01 PM
glennzo's Avatar
glennzo Online
Un-Retired Administrator
 
Join Date: Mar 2004
Location: Salem, Mass USA
Posts: 13,930
linuxchrome
Re: What's wrong with this tar command?

Dunno. Baffling the heck out of me. I could have sworn that it worked fine earlier today. Now I changed -czvf to -zvcf and it works. That can't be the trouble, could it?

Error messages are so cryptic sometimes, aren't they?

Here's the complete script as it stands now.

PHP Code:
#!/bin/bash
# - bup.sh
# - A script to backup scripts
#
# - Glenn A. Johnson - November 27, 2011
# - Last edited March 24, 2012
#
BACKUP_DIR="/mnt/disk3/backup"
BACKUP_NAME="scripts-`date +%Y%m%d`.tar.gz"
#
# - Must be root user to run script
#
if [[ $EUID -ne 0 ]] ; then
   
echo "You need to run this script with root permissions"
   
exit 1
fi
#
# - Source my include files
includes
scolors
#
# - Run the backup archiving all files in the current folder
#
tar -zvcf $BACKUP_DIR/$BACKUP_NAME *
#
# - Finish up and exit
echo -${txtgrn}"Backup file ${txtred}$BACKUP_NAME ${txtgrn}created.\nScript run completed."${txtrst}
exit 

__________________
Glenn
The Bassinator © ®


Laptop: Toshiba Satellite / Intel Core 2 Duo 1.73 GHz / 2GB / 160GB / Intel Mobile 945GM/GMS/GME/943/940GML Integrated Graphics
Desktop: BioStar MCP6PB M2+ / AMD Phenom 9750 Quad Core / 4GB / 1TB SATA / 500GB SATA / EVGA GeForce 8400 GS 1GB
Reply With Quote
Reply

Tags
command, tar, wrong

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
wrong execution of command..... mogli Using Fedora 1 5th August 2009 03:48 AM
Command Df Shows Wrong Available Space? dealmaker Using Fedora 5 15th October 2005 06:25 AM
"Hard link count is wrong for /proc" error using find command ChasJaxFL Using Fedora 5 13th July 2005 09:07 PM


Current GMT-time: 15:14 (Wednesday, 22-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat