telina
telina

Reputation: 166

rsync not copying my files

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?

Upvotes: 1

Views: 1968

Answers (1)

Kent
Kent

Reputation: 195059

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

Upvotes: 8

Related Questions