B
B
BlagoYar Silence2021-12-05 03:28:37
linux
BlagoYar Silence, 2021-12-05 03:28:37

How to unpack tar with replacement to a specific folder?

You need to unpack the archive, which has files and subfolders with files.
But you need to do this on top of existing files and subfolders.
Is the command correct?

tar -C /root/backup_srv/mount/SERVER -xvjf --overwrite /root/backup_srv/mount/gdrive/backup_srv_arch/ARCHIVE.tar.bz2

Answer the question

In order to leave comments, you need to log in

1 answer(s)
H
hint000, 2021-12-05
@hint000

Seems right, although this is the first time I see the -C option and I had to look at man tar.

xkcd
https://xkcd.com/1168/tar.png

I would do
cd /root/backup_srv/mount/SERVER && tar -xvjf --overwrite /root/backup_srv/mount/gdrive/backup_srv_arch/ARCHIVE.tar.bz2

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question