M
M
mobydig2018-04-16 14:36:52
linux
mobydig, 2018-04-16 14:36:52

How to solve problem with tar incremental?

The task is to backup the site folder via cron using incremental.
The code is the following:

cd /home/
tar --create --gzip \
--file=backups/`date +%F-%s`_ru.tar.gz \
--listed-incremental=backups/meta_ru \
--no-check-device \
--exclude-vcs \
--exclude-tag-under=access.log \
--exclude='*.log' \
--exclude-caches \
--exclude-tag-under=IGNORE.TAG \
ru

At the first start, we got an archive with the following folders inside:
5ad486cdc8ad0858582896.png
The files of the reserved directory RU are distributed inside the archive into folders "ru", "13264015404/ru", etc.
Question: What is the logic behind this?
In theory, the archive should contain only a reserved directory with all files.
At the second launch (none of the files in the reserved directory RU has changed), an archive of about 10 MB is created. Inside the archive, there are many nested empty folders, such as "ru\public_html\content\site1\pages\page_name\prev". Question: How to deal with it? How not to include directories that don't have modified files?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
D
Dmitry, 2018-04-16
@Tabletko

You should not open *.tar files created in unix/linux by Windows archivers.

R
Roman Ratkin, 2018-04-16
@Hanharr

How not to include directories that don't have modified files?

man find

S
Saboteur, 2018-04-16
@saboteur_kiev

Suppose you have backups
1
2
3
4
How should the next incremental backup find out what was backed up in 2, 3, 4?
Therefore, tar preserves the meta information.
PS Windows archivers may not correctly see the contents of a .tar archive. Use a ported tar.

P
pfg21, 2018-04-16
@pfg21

I myself recently encountered this, and opened it in Far Total 7zip ...
I have a feeling that they use the same tar code, which has an error.
Moreover, even compiling Gnuwin Tar gives the same error , and this is already more interesting.
those. the
tar -tf ./srv3-2018-04-11-diff.tar command
under Windows produces similar rubbish.
/./
13070423312 13070423315 / bin /
12321613446 / boot /
12703176216 / boot / grub /
12703176351 / boot / grub / fonts /
12703176342 / boot / grub / i386-pc /
12703176342 / boot / grub / locale /
12560315617 / etc /
12560315525 / etc/X11/
13046047347/etc/X11/Xreset.d/
And there is a tool for WindowsTartool, which adequately unpacks the same tar archive, means that the matter in the source codes
should be written to the developers, or at least I’ll raise a stackover flow on some thread, but it’s not okay with the English ...
who is friendly with the English - knock on there.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question