Re: rsync --delete
Hi Mike,
On Fri, Oct 16, 2020 at 05:09:42PM -0500, Mike McClain wrote:
> A section of the backup script is so:
> Params=(-a --inplace --delete);
> Flash=/sda/rpi4b
> cd /home/mike
> [ ! -d $Flash/mike ] && mkdir $Flash/mike;
>
> # exclude compressed files and the contents of most of the .* directories
> /mc/bin/mk_rsync_exclude.sh
> echo /usr/bin/rsync $Params --exclude-from=/home/mike/.rsync_exclude . $Flash/mike
shellcheck has this to say:
$ shellcheck ./foo.sh
In ./foo.sh line 6:
echo /usr/bin/rsync $Params --exclude-from=/home/mike/.rsync_exclude . $Flash/mike
^-- SC2128: Expanding an array without an index only gives the first element.
It's worth using shellcheck.
Cheers,
Andy
--
https://bitfolk.com/ -- No-nonsense VPS hosting
Reply to: