LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 12-11-2009, 11:44 AM   #1
steve51184
Member
 
Registered: Dec 2006
Posts: 381

Rep: Reputation: 30
how do i tar a folder to another location?


how do i tar a folder to another location like if i want to backup my /var/www folder to /backup ?

atm i'm doing this to tar and then move it:

Code:
tar -czvf www.tgz /var/www
mv /var/www.tgz /backup
 
Old 12-11-2009, 11:59 AM   #2
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297
Hi,

Have a look at the man page of tar to find all options.
Code:
man tar
The easiest way would be to just put it in one command like this:
Code:
tar -czvf /backup/www.tgz /var/www
to create a compressed tar file of /var/www into a file named www.tgz that will be created under the directory /backup.

Kind regards,

Eric
 
Old 12-11-2009, 12:05 PM   #3
steve51184
Member
 
Registered: Dec 2006
Posts: 381

Original Poster
Rep: Reputation: 30
ouch my bad... walks away in shame lol

thanks
 
Old 12-11-2009, 12:15 PM   #4
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297
No problem, sometimes one gets so involved in complex things that he/she overlooks the obvious (know that from past experience).

Kind regards,

Eric
 
Old 12-11-2009, 12:36 PM   #5
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
The easiest questions are often the most difficult because we assume the answer is difficult. This can be a conscious or unconscious process. In some contexts, it's called a "self-fullfilling prophecy"----as in: "I could never learn to fly an airplane."
 
  


Reply



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
want to 'tar' a folder without some contents of folder shipon_97 Linux - Newbie 5 10-13-2007 04:21 AM
Location of mozilla plugin folder? Maverick1182 Linux - Newbie 4 10-31-2006 05:24 AM
Location of Thunderbird Application folder Maverick1182 Linux - Software 1 09-18-2006 06:36 AM
Gnome Desktop Folder Location Cottsay Fedora 4 03-02-2006 03:52 PM
Folder location of new files timsch75 Linux - Newbie 2 03-22-2004 10:02 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:57 AM.

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
Open Source Consulting | Domain Registration