Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.debian.user > #227952
| From | Mike McClain <mike.junk.46@att.net> |
|---|---|
| Newsgroups | linux.debian.user |
| Subject | Re: rsync --delete |
| Date | 2020-10-19 01:40 +0200 |
| Message-ID | <B1qro-4Vv-11@gated-at.bofh.it> (permalink) |
| References | <B12yK-7sb-13@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Sat, Oct 17, 2020 at 03:01:13PM -0700, David Christensen wrote:
>
> Is /sda the mount point for your backup media? If so, that is confusing --
> 'sda' implies '/dev/sda', which should be your system drive (e.g. root). I
> would label the backup filesystem 'backup-rpi4b' and mount it at
> '/mnt/backup-rpi4b' or '/media/backup-rpi4b' (your desktop might be able to
> do this for you).
I'm a lousy/lazy typist so mount a USB flash drive at /dev/sda1 on /sda.
> If the script must change the working directory, I would display that --
> 'set -x', 'cd ...', and 'set +x'.
I did adopt this suggestion.
> I would do an old-school 'if' block and display that a directory is being
> created -- 'set -x', 'mkdir ...', 'set +x'.
> What is /mc?
/mc is simply a directory I put docs/scripts I create and/ or collect
that are not part of any installation.
There is an /mc/docs/, an /mc/bin/ and a couple of others, sometimes.
> mk_rsync_exclude.sh creates '.rsync_exclude' in the current working
> directory?
Yes.
> > echo /usr/bin/rsync $Params --exclude-from=/home/mike/.rsync_exclude . $Flash/mike
> > /usr/bin/rsync $Params --exclude-from=/home/mike/.rsync_exclude . $Flash/mike ||
> > echo rsync $Params --exclude-from=/home/mike/.rsync_exclude . $Flash/mike Failed $? ;
> You cut and pasted the following code three times:
>
> /usr/bin/rsync $Params --exclude-from=/home/mike/.rsync_exclude . $Flash/mike
>
> DRY: https://en.wikipedia.org/wiki/Don%27t_repeat_yourself
I've seen this just haven't it ingrained yet.
> I prefer 'set -x', 'command ...', and 'set +x' when I want to see what the
> shell is actually doing (which might not be the same output as 'echo ..').
and this one.
>
> I use 'set -e' at the top of my scripts so that the shell will stop and
> display an error message if a script command fails.
>
>
> /usr/bin/rsync -- I also use absolute paths for tools. But, I put them into
> upper-case variables at the top of my script.
>
> --exclude-from -- It is too easy to screw up exclude specifications and
> exclude a file you need. Therefore, I backup entire filesystems.
We have different needs.
> When invoking rsync(1), I make sure that SRC and DEST are directories, that
> their paths are absolute, and that their paths end with '/'. This prevents
> confusion and works as I expect.
> David
I've taken several of your suggestions.
Thanks for the feedback.
Be well,
Mike
--
If everything seems to be going well, you have obviously overlooked something........
Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
rsync --delete Mike McClain <mike.junk.46@att.net> - 2020-10-17 00:30 +0200
Re: rsync --delete Klaus Singvogel <deb-user-ml@singvogel.net> - 2020-10-17 00:40 +0200
Re: rsync --delete Greg Wooledge <wooledg@eeg.ccf.org> - 2020-10-19 13:40 +0200
Re: rsync --delete ellanios82 <ellanios82@gmail.com> - 2020-10-17 00:40 +0200
Re: rsync --delete Charles Curley <charlescurley@charlescurley.com> - 2020-10-17 04:10 +0200
Re: rsync --delete Will Mengarini <seldon@eskimo.com> - 2020-10-17 08:40 +0200
Re: rsync --delete Greg Wooledge <wooledg@eeg.ccf.org> - 2020-10-19 13:50 +0200
Re: rsync --delete <tomas@tuxteam.de> - 2020-10-17 10:40 +0200
Re: rsync --delete David <bouncingcats@gmail.com> - 2020-10-17 14:20 +0200
Re: rsync --delete <tomas@tuxteam.de> - 2020-10-17 15:30 +0200
Re: rsync --delete Mike McClain <mike.junk.46@att.net> - 2020-10-17 20:30 +0200
Re: rsync --delete Greg Wooledge <wooledg@eeg.ccf.org> - 2020-10-19 13:50 +0200
Re: rsync --delete Andrei POPESCU <andreimpopescu@gmail.com> - 2020-10-18 12:50 +0200
Re: rsync --delete Andy Smith <andy@strugglers.net> - 2020-10-17 17:30 +0200
Re: rsync --delete David Christensen <dpchrist@holgerdanske.com> - 2020-10-18 00:10 +0200
Re: rsync --delete Mike McClain <mike.junk.46@att.net> - 2020-10-19 01:40 +0200
Re: rsync --delete Greg Wooledge <wooledg@eeg.ccf.org> - 2020-10-19 14:00 +0200
Re: rsync --delete Mike McClain <mike.junk.46@att.net> - 2020-10-19 21:10 +0200
Re: rsync --delete Greg Wooledge <wooledg@eeg.ccf.org> - 2020-10-19 21:20 +0200
Re: rsync --delete Tixy <tixy@yxit.co.uk> - 2020-10-19 23:20 +0200
Re: rsync --delete David Christensen <dpchrist@holgerdanske.com> - 2020-10-20 05:10 +0200
Re: rsync --delete Tixy <tixy@yxit.co.uk> - 2020-10-20 09:30 +0200
Re: rsync --delete David <bouncingcats@gmail.com> - 2020-10-20 10:00 +0200
Re: rsync --delete Tixy <tixy@yxit.co.uk> - 2020-10-20 10:20 +0200
Re: rsync --delete Andrei POPESCU <andreimpopescu@gmail.com> - 2020-10-20 11:10 +0200
Re: rsync --delete David <bouncingcats@gmail.com> - 2020-10-19 23:20 +0200
Re: rsync --delete David Christensen <dpchrist@holgerdanske.com> - 2020-10-20 05:20 +0200
Re: rsync --delete David <bouncingcats@gmail.com> - 2020-10-20 06:10 +0200
Re: rsync --delete Nicolas George <george@nsup.org> - 2020-10-20 12:10 +0200
Re: rsync --delete Greg Wooledge <wooledg@eeg.ccf.org> - 2020-10-20 13:50 +0200
Re: rsync --delete The Wanderer <wanderer@fastmail.fm> - 2020-10-20 14:50 +0200
Re: rsync --delete Greg Wooledge <wooledg@eeg.ccf.org> - 2020-10-20 15:10 +0200
Re: rsync --delete The Wanderer <wanderer@fastmail.fm> - 2020-10-20 15:50 +0200
Re: rsync --delete Greg Wooledge <wooledg@eeg.ccf.org> - 2020-10-20 16:10 +0200
define (or translate, or substitute for) "interpolate": Re: rsync --delete rhkramer@gmail.com - 2020-10-19 14:30 +0200
Re: define (or translate, or substitute for) "interpolate": Re: rsync --delete rhkramer@gmail.com - 2020-10-19 14:50 +0200
Re: define (or translate, or substitute for) "interpolate": Re: rsync --delete <tomas@tuxteam.de> - 2020-10-19 15:00 +0200
Re: define (or translate, or substitute for) "interpolate": Re: rsync --delete rhkramer@gmail.com - 2020-10-20 02:10 +0200
Re: define (or translate, or substitute for) "interpolate": Re: rsync --delete David Christensen <dpchrist@holgerdanske.com> - 2020-10-20 05:50 +0200
Re: rsync --delete Greg Wooledge <wooledg@eeg.ccf.org> - 2020-10-19 14:10 +0200
csiph-web