Skip to main content
Title and general markup improvements. Tiny grammar fixes.
Source Link
Kusalananda
  • 355.9k
  • 42
  • 735
  • 1.1k

Rsync exclude and include problemproblem; include file in excluded directory

I know this question has been asked alot but I still have issues with it.

I want to do the following with rsyncrsync.

Directory structure example

  • home/netadmin/docker-data
  • home/netadmin/docker-data/uptime-kuma/
  • home/netadmin/docker-data/uptime-kuma/error.log

I want to rsyncrsync the docker-datadocker-data directory but want to exclude the home/netadmin/docker-data/uptime-kuma/home/netadmin/docker-data/uptime-kuma/ directory but want to include home/netadmin/docker-data/uptime-kuma/errorhome/netadmin/docker-data/uptime-kuma/error.log.log

I'm using the following command :

rsync -av --delete --include-from='/home/netadmin/include.txt' --exclude-from='/home/netadmin/exclude.txt' /home/netadmin/docker-data /home/netadmin/temp/

rsync -av --delete --include-from='/home/netadmin/include.txt' --exclude-from='/home/netadmin/exclude.txt' /home/netadmin/docker-data /home/netadmin/temp/

The directory is being excluded but the file is not copied.

My question is, is it posiblepossible?

This is how my include and exclude files lookslook like :

exclude.txt uptime-kuma/

uptime-kuma/

include.txt

  • error.log
+ error.log

Rsync exclude and include problem

I know this question has been asked alot but I still have issues with it.

I want to do the following with rsync.

Directory structure example

  • home/netadmin/docker-data
  • home/netadmin/docker-data/uptime-kuma/
  • home/netadmin/docker-data/uptime-kuma/error.log

I want to rsync the docker-data directory but want to exclude the home/netadmin/docker-data/uptime-kuma/ directory but want to include home/netadmin/docker-data/uptime-kuma/error.log

I'm using the following command :

rsync -av --delete --include-from='/home/netadmin/include.txt' --exclude-from='/home/netadmin/exclude.txt' /home/netadmin/docker-data /home/netadmin/temp/

The directory is being excluded but the file is not copied.

My question is, is it posible?

This is how my include and exclude files looks like :

exclude.txt uptime-kuma/

include.txt

  • error.log

Rsync exclude and include problem; include file in excluded directory

I want to do the following with rsync.

Directory structure example

  • home/netadmin/docker-data
  • home/netadmin/docker-data/uptime-kuma/
  • home/netadmin/docker-data/uptime-kuma/error.log

I want to rsync the docker-data directory but want to exclude the home/netadmin/docker-data/uptime-kuma/ directory but want to include home/netadmin/docker-data/uptime-kuma/error.log.

I'm using the following command :

rsync -av --delete --include-from='/home/netadmin/include.txt' --exclude-from='/home/netadmin/exclude.txt' /home/netadmin/docker-data /home/netadmin/temp/

The directory is being excluded but the file is not copied.

My question is, is it possible?

This is how my include and exclude files look like :

exclude.txt

uptime-kuma/

include.txt

+ error.log
Source Link

Rsync exclude and include problem

I know this question has been asked alot but I still have issues with it.

I want to do the following with rsync.

Directory structure example

  • home/netadmin/docker-data
  • home/netadmin/docker-data/uptime-kuma/
  • home/netadmin/docker-data/uptime-kuma/error.log

I want to rsync the docker-data directory but want to exclude the home/netadmin/docker-data/uptime-kuma/ directory but want to include home/netadmin/docker-data/uptime-kuma/error.log

I'm using the following command :

rsync -av --delete --include-from='/home/netadmin/include.txt' --exclude-from='/home/netadmin/exclude.txt' /home/netadmin/docker-data /home/netadmin/temp/

The directory is being excluded but the file is not copied.

My question is, is it posible?

This is how my include and exclude files looks like :

exclude.txt uptime-kuma/

include.txt

  • error.log