D&C GLug - Home Page

[ Date Index ] [ Thread Index ] [ <= Previous by date / thread ] [ Next by date / thread => ]

Re: [LUG] rsync error.. tries to copy Trash folder

 

On 05/11/17 16:42, mr meowski wrote:
On 05/11/17 13:19, Julian Hall wrote:
Hi All,

Doing a weekly backup of my NAS by rsync I keep getting an error when it
tries to copy the Trash folder, which obviously I don't want it to copy
anyway:

rsync: opendir "/media/julian/DIANA/.Trash-1000" failed: Permission
denied (13)

I have tried excluding the specified folder as follows;

sudo rsync -aAXv /media/julian/CASSIOPEIA /media/julian/ARTEMIS/
--delete --exclude={/media/julian/CASSIOPEIA/.Trash-1000}

However it seems to ignore the exclusion. It's not a huge problem as
everything else copies properly, it's just an irritant.

Any thoughts please?
Hi Mr Meowski,
Either your copy/pasting has gone wrong or something more insidious is
afoot... Your command looks sorta legit, if formatted a bit strangely -
I'd do it like this:

rsync -aAXSv --delete --exclude{.Trash-1000} /media/julian/CASSIOPEIA
/media/julian/ARTEMIS/
I tried that as the normal user julian and had this error:

julian@Cerce ~ $ rsync -aAXSv --delete --exclude{.Trash-1000} /media/julian/CASSIOPEIA /media/julian/ARTEMIS
rsync: --exclude{.Trash-1000}: unknown option
rsync error: syntax or usage error (code 1) at main.c(1572) [client=3.1.1]
julian@Cerce ~ $
Your excludes should be relative to the "left side" filepath which as
"/media/julian/CASSIOPEIA" means you only pass it the extra argument
".Trash-1000" rather than the full
"/media/julian/CASSIOPEIA/.Trash-1000" - but watch out for those
trailing slashes which will seriously effect rsync's behaviour.
Then I tried the following, after your advice about not requiring the full path; it was probably looking for /media/julian/CASSIOPEIA/media/julian/CASSIOPEIA/.Trash-1000 which of course doesn't exist. So I modified my original command to give:

rsync -aAXv /media/julian/CASSIOPEIA /media/julian/ARTEMIS/ --delete --exclude={.Trash-1000}

That worked perfectly and with the normal user not sudo. You were right about DIANA by the way.. I copied and pasted the wrong example line, although I was getting the error for all my partitions.

Kind regards,

Julian

--
The Mailing List for the Devon & Cornwall LUG
https://mailman.dclug.org.uk/listinfo/list
FAQ: http://www.dcglug.org.uk/listfaq