Rsync backup confusion

Ubuntu Version: 24.04 LTS

Problem Description:
I’m using rsync to backup the /shared volume:
rsync -ah -H -A -X --info=progress2 --info=name0 /shared/ /media/amonra/Seagate_16TB/

When I do a df -h I see:

/dev/sdb         28T  6.3T   20T  25% /shared
/dev/sdc1        15T   11T  3.1T  78% /media/amonra/Seagate_16TB 

which doesn’t make sense to me. The only stuff on /dev/sdc1 is from previous rsync using the same options. so why does the target drive show 11T used while the source only has 6.3T used?

Both are ext4 file systems

Thanks, David

I suspect what you are seeing is due to your choice of command features.

Rsync does not create a mirror of source at target unless you tell it to. Therefore, your target will usually grow bigger, over time, because it never overwrites, deletes, or moves anything at target unless you tell it to. For example, if you move files around at source rsync will keep the original location copy while creating the new location as well.. unless you tell it otherwise. Read up on the (delete) switch in the rsync manpage. The switch is preceded by 2 dashes, which I would show here but the iPhone doesn’t display 2 dashes correctly.

Three things to do before using the delete feature:

  • create a separate backup of everything and know how to recover it.

  • read up on the feature until you understand what it does.

  • Always run the command first with the -n (dry-run) switch, and -v (verbosity), and see what it will do if you run that command. It simulates the command allowing you to read the output before actually making any changes. Make sure the output is exactly what you want before removing the -n making it permanent.

2 Likes

read about --delete argument

1 Like

You might also want to look at the following 2 postings that involve the same scenario, offering some additional insights/perspectives on the issue:

1 Like

This topic was automatically closed 18 hours after the last reply. New replies are no longer allowed.