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? Code:
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 / Code:
home/joe/Documents/Restored_Files/home/joe/Documents I would like to restore without full path as below: Code:
/home/joe/Documents/Restored_Files/Documents can you help me? |
giobaxx,
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: Code:
cd /home/joe |
All times are GMT -5. The time now is 05:22 PM. |