debian – Archiving large volumes of scattered directories

Question:

I plan to move to another car, the current one has about 300 GB of data, and everything is scattered everywhere.

I would like to create a complete dump of all directories, well, download it to my new machine, and then pull it out from there if you need something (that is, not all at once).

By what means can this thing be done?

Answer:

Let's say you want to archive the contents of the directories:

/var/www
/var/vcs
/home/user

you can, for example, like this:

$ sudo tar -cf /путь/к/архиву.tar -C / var/www var/vcs home/user

In this case, compression, in my opinion, is not worth using – unpacking will work faster.

when you need to extract from the created archive, for example, home/user to the /распаковка/home/user directory, you can do it like this:

$ sudo tar -xf /путь/к/архиву.tar -C /распаковка home/user

both the rights and ownership of files / directories will be correctly restored (just keep in mind that the ownership is saved not in the form of strings, but in the form of numbers – the user number and group number).

Scroll to Top
AllEscort