In article <1160687866.234253.316810@xxxxxxxxxxxxxxxxxxxxxxxxxxx>,
"amit" <amit.kohan@xxxxxxxxx> wrote:
> Hello Group,
>
>
> How can I make rsync in this command?
>
> rsync -z -perms --progress --stats -b --backup-dir=/Thursday -a -r
> /usr/local/ldb/db/[0-9]/aDir
> /root/backups/Thursday/ldb/db/[0-9]/aDir
>
>
> where [0-9] stands for directories with numeric names.
I'm assuming that the numeric names can be more than one character. I
haven't used --backup-dir, and upon first reading of the man page, it
confuses the heck out of me, and when I tried to figure it out
experimentally--it didn't seem to do anything. So, keeping in mind that
what follows may be totally off because I don't know what your command
is actually trying to do, here's a general outline.
(cd /usr/local/ldb/db; ls) | grep '^[0-9][0-9]*$' | while read name
do
if [ -d /usr/local/ldb/db/$name ]
then
SRC=/usr/local/ldb/db/$name/aDir
DST=/root/backups/Thursday/ldb/db/$name/aDir
rsync [your options] $SRC $DST
fi
done
--
--Tim Smith
|
|