I've been using rsync in a bash script to make hourly copies of jpeg files that are created every few minutes. The images are contained in a number of subdirectories, with the filenames using the date and time
Quote:
data/images/GARI/GARI_20100825_135403.jpg
data/images/GARI/GARI_20100825_135903.jpg
data/images/FRED/FRED_20100825_135407.jpg
|
At the moment, my source and target directories are identical, and rsync is easy:
Quote:
rsync -av data/images/ /mnt/data/images
|
Note that the source directory is purged at regular intervals to stop it filling up. So the target directory has all the images, but the source doesn't.
I need to change my script so that the target directory has a different structure from the source directory, like this:
Quote:
/mnt/data/images/GARI/2010/2010-08/GARI_20100825_135403.jpg
/mnt/data/images/GARI/2010/2010-08/GARI_20100825_135903.jpg
/mnt/data/images/FRED/2010/2010-08/FRED_20100825_135407.jpg
|
Is there any way I can do this with rsync in a bash script?