I am thinking how to recover .tar.gz HOME backup into almost a new Debian system safely (some files can exist and should be preserved so
My main PC broke so I have to use a backup Debian system but I need my HOME backups (only the following home files) of the main system.
Characteristics of the system
Code to make the home backup as root
#1. [but fails with circular symlinks]
# http://unix.stackexchange.com/a/291720/16920 nice tar czf /media/masi/ext4Masi/backup_home_20.12.2016.tar.gz $HOME/
There are symlinks in my directories.
I have noticed that the tarball does not contain all directories such as
/home/masi/Documents/. The directory has many symlinks and maybe also some circular symlinks.
The tarball then again contains
$HOME/Downloads which should not contain any circular symlinks, and
Downloads directory has no symlinks at all.
#2. [Rejected because will cause much duplicate files]
tar czf --dereference \ /media/masi/ext4Masi/backup_home_20.12.2016.tar.gz $HOME/
Code to use the backup [deprecated; use
tar xzfC ...]
rsync can be the right choice here without deletes but with
-u option about skip any files for which the destination file already exists and has a date later than the source file
(requirement about almost);
pseudocode because I think
.tar.gz cannot be input there
# http://unix.stackexchange.com/a/287016/16920 rsync -rtvuc --progress \ /media/masi/ext4Masi/backup_home_20.12.2016.tar.gz $HOME/
However, I am still unsure
- about maintaining the file-directory hierarchy correctly
- how can you have
.tar.gzfile as input of
OS: Debian 8.5