Question

I was trying to use rsync to only copy the .c files from a given directory. Therefore I tried this command:

rsync -nrv --include="*.c" --exclude="*" test/ temp/

The output:

sending incremental file list
test1.c
test2.c

sent 63 bytes  received 18 bytes  162.00 bytes/sec

The data I wanted to be copied was found, but when I check 'temp', it is empty. I also tried to let rsync create the directory and the output is the following:

sending incremental file list
created directory temp
./
test1.c
test2.c

sent 66 bytes  received 21 bytes  174.00 bytes/sec

But when I check for the directory 'temp', it doesn't exist. What am I doing wrong?

Was it helpful?

Solution

you gave -n, which means "dry run"!

remove the -n

you should at least check man page for the options you used, to understand the meanings:

 -n, --dry-run               perform a trial run with no changes made
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top