include file to save in rsync

hi

I try to save some folder with rsync.

In a script I have

#!/bin/sh


# directory to backup
BDIR=/home/$USER

#destination hard drive verbatim
DEST=/run/media/collinm/verbatim

#destination usb key
#/run/media/collinm/PATRIOT/
#DEST=/run/media/collinm/PATRIOT


EXCLUDES=/home/$USER/bin/exclude.txt

#include file
INCLUDES=/home/$USER/bin/include.txt

#verbatim
rsync -a -r  --delete --prune-empty-dirs -delete --delete-excluded --include-from=$INCLUDES --exclude-from=$EXCLUDES  $BDIR $DEST

In my include file I have

+ .config/
+ .config/Subsurface/***
+ .subsurface/***
+ .VirtualBox/***
+ .ICAClient/***
+ .wine/***
+ /run/media/bob/Data/
+ /run/media/bob/Data/Music
+ /run/media/bob/Data/Music/***
+ /run/media/bob/Data/Pictures/
+ /run/media/bob/Data/Pictures/***
- .**

In my exclude file


Desktop/
dwhelper/
Public/
public_html/
Templates/
Videos/
VirtualBox VMs/
.*

In the saved area, I don’t see Music and Pictures folder

You back up directory /home/bob, but include files from /run. Why do you expect them to match?

if in

/home/collinm/Music i have a link who point to
/run/media/bob/Data/Music

if there a way to copy the content instead of only the symbolink link?

Of course. There are a lot of options to affect symlink handling, just read rsync manual page carefully. -L will follow all symlinks.

-L seem doing the job