Parador
Parador

Reputation: 3

Rsync - regex for partial folder sync (folder starting with A to M)

I'm new to stackoverflow and hope i do everything right.

Can anybody help me? I have a raid volume that I would like backup/sync to two other drives. The two other drives are in sum the same size than the raid volume... But how can I tell rsync to sync only the (root)folders starting with A to M to the first drive and N-Z to the second drive? (including all the subdirectorys, and files). My regex knowledge is nearly zero.

And no I dont want to make a raid volume out of the two drives.

Or is there an option in rsync to sync to two drives (if first is full, use second..)?

Thanks for your Ideas and help in advance.

Upvotes: 0

Views: 2497

Answers (1)

Rajeev Ranjan
Rajeev Ranjan

Reputation: 4086

Try using the following for the 1st

--exclude "/[N-Z]*/**"

and following for the 2nd

--exclude "/[A-M]*/**"

The man page would help you for creating the pattern.

Upvotes: 1

Related Questions