Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 11-13-2016, 08:29 AM   #1
Registered: Jul 2013
Posts: 37

Rep: Reputation: Disabled
backup/restore HomeFolder/DataFolder with Tar without full path

Hello guys, first sorry for my basic english. I had to started to work with linux, even if for the moment a i make basics things i would like to do it in the better way as possible

Sometimes i have to move data between Ubuntu Workstation, mainly data from home profile but not only

if i want to backup the home folder of a standard user joe using my administrative accounts admin
i run the following command:

I want to save only the data preserving the permission(not temp files, configuration files, cache files, hidden files )

Can you tell me if the command below is a good choice?

tar -cpvzf /mnt/mybackup_Folder/back_joe.tar.gz /home/joe --exclude='.*'

When i restore the tar it recreate all the full path. So for example if i restore the tar inside /home/joe/Document/Restored_Files i will found


I would like to restore without full path as below:

I tried with the option -C but maybe i didnt undestand as it works...

can you help me?
Old 11-13-2016, 01:00 PM   #2
Registered: Sep 2003
Location: 19th moon ................. ................Planet Covid ................Another Galaxy;............. ................Not Yours
Posts: 705

Rep: Reputation: Disabled

If you just want to avoid having the home directory in the path, you can manually cd into the home directory, before running tar; then instead of using for example /home/joe in the tar command, use the "period" character, like this:

cd /home/joe
tar -cpvzf /mnt/mybackup_Folder/back_joe.tar.gz  .  --exclude='.*


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
tar the last periodic backup that is in another path and move the tar to some dir nelovicov Linux - Newbie 6 01-20-2012 09:40 AM
BackUp & Restore with TAR (.tar / .tar.gz / .tar.bz2 / tar.Z) asgarcymed Linux - General 5 12-31-2006 02:53 AM
Backup and Restore with TAR jay2809 Linux - Newbie 7 08-25-2004 04:47 PM
backup and restore using tar AZDAVE Linux - General 6 11-28-2003 08:40 PM
how can I restore a tar backup len snelly Linux - Newbie 1 04-30-2002 12:29 PM > Forums > Linux Forums > Linux - Newbie

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

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