LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-02-2009, 01:17 AM   #1
windstory
Member
 
Registered: Nov 2008
Posts: 486

Rep: Reputation: 36
tar backup script error!


This is a tar backup script for full backup.

Code:
#!/bin/bash
DATE=`date +"%Y%m%d"`
BACKUP_DIR=/_work/_backup
SOURCE_DIR=/var/www/html/dm

tar -g ${BACKUP_DIR}/html_full_bak_${DATE}.list -W zcvpf ${BACKUP_DIR}/html_full_bak_${DATE}.tgz ${SOURCE_DIR}/ --exclude ${SOURCE_DIR}/data
And the result is here.
Quote:
[root:localhost:~/backup_script]# ./full_backup.sh
tar: You must specify one of the `-Acdtrux' options
Try `tar --help' or `tar --usage' for more information.

Any help would be appreciated.
 
Old 11-02-2009, 01:20 AM   #2
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Nagpur, India
Distribution: Cent OS 5/6, Ubuntu Server 10.04
Posts: 4,629

Rep: Reputation: Disabled
If you are creating a new tar then you have to use -c option. See man tar for more option.
 
Old 11-02-2009, 01:29 AM   #3
windstory
Member
 
Registered: Nov 2008
Posts: 486

Original Poster
Rep: Reputation: 36
Quote:
Originally Posted by linuxlover.chaitanya View Post
If you are creating a new tar then you have to use -c option. See man tar for more option.
I used "zcvpf" option. As you can see, "c" is included. Do I write "czvpf"?
 
Old 11-02-2009, 01:37 AM   #4
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,240

Rep: Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324
1. One of these must be the first option
Quote:
tar: You must specify one of the `-Acdtrux' options
2. -g is GNU incremental backup, but your naming convention suggests a full backup....
 
Old 11-02-2009, 02:52 AM   #5
windstory
Member
 
Registered: Nov 2008
Posts: 486

Original Poster
Rep: Reputation: 36
Quote:
Originally Posted by chrism01 View Post
1. One of these must be the first option

2. -g is GNU incremental backup, but your naming convention suggests a full backup....
Thanks a lot.
I misunderstood it.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Backup Script Using tar - Error "file changed as we read it" 3rods Linux - Software 6 03-08-2014 06:18 AM
[SOLVED] tar backup Bash script help speedhunt3r Linux - General 4 10-27-2009 04:08 AM
script that shows progress in a tar backup kaplan71 Linux - Software 1 03-17-2009 04:44 PM
Basic backup script using Tar GraemeK Linux - General 1 09-17-2004 06:19 AM
Backup script to tar untoldone Programming 2 05-20-2004 04:03 PM


All times are GMT -5. The time now is 11:08 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration