LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-19-2016, 08:47 PM   #1
talkinggoat
Member
 
Registered: Sep 2003
Location: lafayette, la
Distribution: RHL 6.2, FC 3, Ubuntu 14.04, Ubuntu 16.04
Posts: 112

Rep: Reputation: 15
rsync --exclude-from not working correctly?


I am trying to exclude a directory from the rsync process, but I can't seem to get it to work. I have tried every permutation I can think up, but it continues to include the directories in the backup process. For example,

- **Trash** should exclude, /Trash/ /.Trash/ /.Trash-0/, /fileTrash/, /Trashcan/ any file with "Trash" in it. Although, this is not really what I want, it's what I've tried, just to get it to exclude /.Trash-0/

rsync continues to include any Trash directory it comes across.

I am using the directive --exclude-from=/root/exclude.list

The file's name is /root/exclude.list and I've made sure rsync is being run by root.

I would think the correct format to exclude, /.Trash-0/ or /.trash-whatever/ would be:

- **/?[Tt]rash*/**

Any ideas?
 
Old 04-19-2016, 09:12 PM   #2
talkinggoat
Member
 
Registered: Sep 2003
Location: lafayette, la
Distribution: RHL 6.2, FC 3, Ubuntu 14.04, Ubuntu 16.04
Posts: 112

Original Poster
Rep: Reputation: 15
I figured out, if there is a space, either before or more than one extra space, after the directive, rsync will ignore it. For example:

"- **trash**"
is not the same as
"- **trash** "
or
"- **trash**"

I also learned the software on this forum will remove unnecessary white spaces, so I can't exactly show you, per-say.

"-__**trash**"
is not the same as
"-_**trash**"
rsync will ignore it.

Last edited by talkinggoat; 04-19-2016 at 09:15 PM.
 
Old 04-19-2016, 09:16 PM   #3
Emerson
LQ Guru
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~arch
Posts: 6,316

Rep: Reputation: Disabled
There is no reason to do this as root. And where is this Trash directory anyway? I assume it is in users home directory, so to exclude it the exclude list should be in users home directory and Trash should be without leading slash.
 
Old 04-19-2016, 09:44 PM   #4
talkinggoat
Member
 
Registered: Sep 2003
Location: lafayette, la
Distribution: RHL 6.2, FC 3, Ubuntu 14.04, Ubuntu 16.04
Posts: 112

Original Poster
Rep: Reputation: 15
Why wouldn't I run it as root? Who else would I run it as, to back up every file? The trash directory is /.Trash-0, in my case, but this applies to every potential file.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
include and exclude in rsync xeon123 Linux - Newbie 4 05-26-2011 11:27 PM
help with rsync exclude files Red Squirrel Linux - Software 4 03-03-2009 10:54 AM
Simple Rsync exclude not working as expected Poetics Linux - Software 5 02-15-2008 11:58 AM
can't get rsync exclude files Batta Linux - Newbie 1 03-27-2006 10:39 PM
rsync exclude list steelhead79 Linux - Software 3 01-14-2005 12:10 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:21 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration