0

I'm trying to tell rsync to ignore my ~/.cache directory, but it doesn't want to listen.

How do I filter a specific dot filename with rsync?

Here, for example, is an attempt to copy nothing but ~/.cache. It also fails.

First, see the size of my ~/.cache directory:

$ du -hs /home/yuzer/.cache
2.1G    /home/yuzer/.cache

Here's my attempt to copy it with ´rsync`:

$ sudo rsync -axvzuhhh --include='.cache' --exclude='*' "/home/yuzer" "/media/yuzer/device"
sending incremental file list
sent 18 bytes  received 12 bytes  60.00 bytes/sec total size is 0 
speedup is 0.00
Cyrus
  • 84,225
  • 14
  • 89
  • 153
markling
  • 1,232
  • 1
  • 15
  • 28

1 Answers1

0

Your command looks like it includes .cache correctly, but unfortunately it excludes everything inside it.

Try this:

--include='.cache/**' --exclude='*'
ams
  • 24,923
  • 4
  • 54
  • 75