Q:

How to "rsync" a catalog to multiple destination catalogs using the same filelist?

I need someone help as I can't find a working solution to copy files from the Source catalog to 2 Destination catalogs using the rsync.
For instance,
I have the Source catalog with the following files 
[root@s001tst-mariadb ~]# ls -l /tmp/SOURCE/
total 8388592
-rw-r--r-- 1 root root 2147479552 Nov 21 16:14 TESTFILE1
-rw-r--r-- 1 root root 2147479552 Nov 21 16:15 TESTFILE2
-rw-r--r-- 1 root root 2147479552 Nov 21 16:15 TESTFILE3
-rw-r--r-- 1 root root 2147479552 Nov 21 16:16 TESTFILE4

And I want to copy that files to the following destinations
[root@s001tst-mariadb ~]# ls -l /tmp/DEST1/ && ls -l /tmp/DEST2/
total 0
total 0

What I need is The rsync must use the same list of the files located in the Source catalog (/tmp/SOURCE/) when it copies to destinations. The rsync must not be run as 2 separate command as the list of files can be changed (eg user added new files while the first rsync is running) and destination catalogs will have different list of files in this case.
I've tried this but it's not working as files from the Source are placed only in one Destination catalog.
[root@s001tst-mariadb ~]# rsync -a  /tmp/SOURCE/ /tmp/DEST2/ /tmp/DEST1

As a solution I can generate list of files manually before and then run the rsync using the manually created filelist file. But I suppose there is something default at the rsync to accomplish this task

Added Later : The found solution

With the --write-batch option I got what I need
** Destinations are empty 
[root@s001tst-mariadb ~]# ls -l /tmp/DEST1/ && ls -l /tmp/DEST2/
total 0
total 0

** Copy files from Source to any Destination 
[root@s001tst-mariadb ~]# rsync --write-batch=ABC -av /tmp/SOURCE/ /tmp/DEST1/
sending incremental file list
./
TESTFILE1
TESTFILE2
TESTFILE3
TESTFILE4

sent 8,592,015,627 bytes  received 95 bytes  350,694,519.27 bytes/sec
total size is 8,589,918,208  speedup is 1.00

** Files are only in 1 catalog 
[root@s001tst-mariadb ~]# ls -l /tmp/DEST1/ && ls -l /tmp/DEST2/
total 8388592
-rw-r--r-- 1 root root 2147479552 Nov 21 16:14 TESTFILE1
-rw-r--r-- 1 root root 2147479552 Nov 21 16:15 TESTFILE2
-rw-r--r-- 1 root root 2147479552 Nov 21 16:15 TESTFILE3
-rw-r--r-- 1 root root 2147479552 Nov 21 16:16 TESTFILE4

** Using the generated script copy files to the another Destination
[root@s001tst-mariadb ~]# ./ABC.sh /tmp/DEST2/
receiving incremental file list
./
TESTFILE1
TESTFILE2
TESTFILE3
TESTFILE4

sent 95 bytes  received 8,592,015,627 bytes  381,867,365.42 bytes/sec
total size is 8,589,918,208  speedup is 1.00

** Now the same list of files are in both catalogs 
[root@s001tst-mariadb ~]# ls -l /tmp/DEST1/ && ls -l /tmp/DEST2/
total 8388592
-rw-r--r-- 1 root root 2147479552 Nov 21 16:14 TESTFILE1
-rw-r--r-- 1 root root 2147479552 Nov 21 16:15 TESTFILE2
-rw-r--r-- 1 root root 2147479552 Nov 21 16:15 TESTFILE3
-rw-r--r-- 1 root root 2147479552 Nov 21 16:16 TESTFILE4
total 8388592
-rw-r--r-- 1 root root 2147479552 Nov 21 16:14 TESTFILE1
-rw-r--r-- 1 root root 2147479552 Nov 21 16:15 TESTFILE2
-rw-r--r-- 1 root root 2147479552 Nov 21 16:15 TESTFILE3
-rw-r--r-- 1 root root 2147479552 Nov 21 16:16 TESTFILE4

When you use --write-batch option a temporary file is created with size equals to sum of all files copied. So you must have sufficient space on your disk.
** Generated Script
[root@s001tst-mariadb ~]# du -hs ABC.sh
4.0K    ABC.sh

** Content of the script
[root@s001tst-mariadb ~]# cat ABC.sh
rsync --read-batch=ABC -av ${1:-/tmp/DEST1/}

** Dump file
[root@s001tst-mariadb ~]# du -hs ABC
8.1G    ABC

A:

RSync has a "Batch Mode" feature that should fit your purposes here. There's an excellent answer by Chloe over on this serverfault thread.
I'd anticipate that the example provided in that answer can be adapted to fit your exact needs fairly easily.

