Mailing List Archive


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

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



Hi Stephen,

On Mon, Jun 4, 2012 at 5:33 AM, Stephen J. Turnbull <stephen@example.com> wrote:
In general it's a good idea to have more logs rather than less.  Why
not just use grep -v on the file (rather than on the rsync messages as
Darrent proposed)?

Yes I could. But it is not a file, but an email (a cron job to be exact), as below:
  SHELL=/bin/bash
  MAILTO=braoult@example.com
  # m h  dom mon dow   command
  10 3 * * 1-7 /home/br/bin/sync.sh -f /home/br/data/sync-br.data 2>&1
  10 2 * * 1-7 /home/br/bin/sync.sh -f /home/br/data/sync-films.data 2>&1
  # MAILTO=bruno.anon@example.com DOES NOT WORK
  10 0 * * 1-7 /home/br/bin/sync.sh -f /home/br/data/sync-private.data 2>&1

Interesting, the second MAILTO does not work too, but it is another issue,
please forget about it...

A "data" file typically contains:

SOURCEDIR=/home/br        # full path
SERVER=terastation        # could also be user@hostname
DESTDIR=/mnt/array1/br        # full path, or relative to home directory on target machine

NYEARS=3
NMONTHS=12
NWEEKS=4
NDAYS=7

EXCLUDE="    --exclude .adobe \
        --exclude .cache \
        --exclude .gvfs \
        --exclude .dvdcss \
        --exclude .local \
        --exclude Cache \
        --exclude .thumbnails \
        --exclude gnutella \
        --exclude bittorent \
        --exclude .macromedia/* \
        --exclude perso \
        --exclude Private \
        --exclude mnt \
        --exclude tera
"

  > I wonder if the best idea could be to build the tree locally, in an
 > archive, and expand it on the remote one. This would work, but I
 > don't like the idea :-)

If you aren't updating the remote, that's the same thing rsync does
except that it streams the archive instead of saving it to a file
first.

Unfortunately, it is verbose for directories (and directories only): Unchanged files
are not logged, as expected. The result is that I get thousands lines mails, for nothing,
and I cannot find easily what was really changed (for directories)...

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