Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [tlug] Help on a script...



Hi Darren,

On Mon, Jun 4, 2012 at 1:11 AM, Darren Cook <darren@example.com> wrote:
> I have a question for you: Do you know how to copy (rsync via ssh) a tree
> only, no files? I just want to avoid long log file, with directories...

Hello Bruno,
Have followed this thread can I confirm your question is:
 * You want rsync to act as now, doing all the copy of new and changed
files
 * You want it to be quieter

Exact. Especially dirs.
 
? And by quieter you mean:
 * Still tell you about files that being copied
 * Not tell you about files that are not changed
 * Not tell you about directories in which no files changed.

Yes. In fact my rsync is quiet about unchanged files. But not about directories.

? When I use rsync I thought it already had that behaviour. It only
shows me a directory in which there are some files it is copying, and
that does not feel like noise.

The rsync command I use is, as follows; I believe it is standard:
 RSYNC="rsync -avz --delete -e ssh --safe-links"

Mine is:
         rsync   \
                -ai \
                --delete \
                --delete-excluded \
                ${EXCLUDE} \
                --modify-window=1 \
                --link-dest="../daily-01" \
                . \
                ${SERVER}:${DESTDIR}/daily-00

${EXCLUDE} is a list of directories and files that are not copied.
${SERVER}:${DESTDIR} are self explanatory.

The complete script was attached in my last email...

To remove mention of the directories completely you could filter output
through grep to remove any lines that end in a forward slash:

 rsync ... source target | egrep -v '/$'

Yes, this is possible. I just wondered if a cleaner way was possible. For instance
creating directories with a first rsync. I tried, but it does not work, the second rsync
is still verbose :-(
A "grep" will also hide directories that I would like to see (for instance new ones).

Thanks anyway,

Bruno.

--
2 + 2 = 5, for very large values of 2.


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links