I have a simple task that I can do with multiple lines but I wanted to run this through just 1 cron job as 1 line, and not have 12 separate lines. Here is the setup:
Have one folder on an image processing share that gets images and moves them to 12 different folders depending on location and other things. Folder names are 1a, 2a, 3a, 4a, 5a, 6a, etc. to 12a. Folders 1a-6a need to go to a mounted drive on dr01 and folders 7a-12a need to go to a mounted folder named dr02. Each of the #a folders have a lot of subfolders and files inside.
So, I want to rsync ../images/1a to ..DR01/1a twice a day. I can do this for each folder individually with:
rsync -avh --remove-source-files /images/1a/ /usr/local/blah/dr02/1a/
I wish that I could just sync the entire directory, but since half of the files are going to one share and the other half to another, I have to break them up.
Is there a better way to do this without having to create 12 rsync jobs to sync each folder? Is there a way to group them in the rsync line or something like that? I used to use union-fs to fuse the DRs together, but that is no longer a working option.
Thanks in advance for any tips that can help me resolve this issue.