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

Re: rsync --delete



On Sat, Oct 17, 2020 at 10:30:04AM +0200, tomas@tuxteam.de wrote:
> On Fri, Oct 16, 2020 at 05:09:42PM -0500, Mike McClain wrote:
> > I've been using rsync to backup to a flash drive but it's not
> > performing exactly as I expected.
>
> I think Will nailed it. Your problem is not an rsync problem,
> but a shell (presumably bash) problem:
>
> Simply do:
>   Params="-a --inplace --delete"
>
> then
>   /usr/bin/rsync $Params [...]
>
> There is one thing I still don't understand about this script. Why does
> it invoke /usr/bin/rsync? Does the script writer know better where the
> "right" rsync lives? Or the sysadmin/user, who is in control of $PATH?
>
> Cheers
>  - t

Tom & Will,
You hit right on the head.
I realized it when seeing Klaus post "Params=-a --inplace --delete".

I know better but write bash scripts so seldom that I forget the
intricacies and switching back and forth between bash, perl and ruby
fogs my mind.

As for your last question, the script is called from cron and I'm
never sure whether cron is going to be able to find things so have
just gotten into the habit of putting the path in.

Thanks for the help,
Mike
--
If a Communist mole got elected as President of the United States,
    how would he act?    -   MM


Reply to: