Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

junglepunk

macrumors newbie
Original poster
Sep 30, 2009
24
0
I am successfully using rsync to backup my mac, however upon backing up my documents folder I found that I just had to many things I needed to exclude so I wanted to switch from regular --exclude to --exclude-from=file.txt

My problem is that when I try to exclude from a file I get a "No such file or directory" error and I don't understand why. Here's an actual output:

Code:
My-MacBook-Pro:~ username$ rsync -arvn --del --exclude-from='/Volumes/Mac\ Data/Users/username/Documents/exclude_doc.txt'  ~/Documents/ root@192.168.0.150:/volume1/documents/
rsync: failed to open exclude file /Volumes/Mac\ Data/Users/gustavlothe/Documents/exclude_doc.txt: No such file or directory (2)
rsync error: error in file IO (code 11) at /SourceCache/rsync/rsync-40/rsync/exclude.c(1005) [client=2.6.9]

I also get that same error if I use the ~ to specify my home folder. There is no difference.

Please help.
 
My problem is that when I try to exclude from a file I get a "No such file or directory" error and I don't understand why.

--exclude-from='/Volumes/Mac\ Data/Users/username/Documents/exclude_doc.txt'

More than likely, it's the combination of quotes and escapes.

Try this (no escape between Mac and Data):
--exclude-from='/Volumes/Mac Data/Users/username/Documents/exclude_doc.txt'


or this (no single quotes around the path):
--exclude-from=/Volumes/Mac\ Data/Users/username/Documents/exclude_doc.txt


Both (either) should work.
 
More than likely, it's the combination of quotes and escapes.

Try this (no escape between Mac and Data):
--exclude-from='/Volumes/Mac Data/Users/username/Documents/exclude_doc.txt'


or this (no single quotes around the path):
--exclude-from=/Volumes/Mac\ Data/Users/username/Documents/exclude_doc.txt


Both (either) should work.

Holy crap. It was because of the escape. I would never have suspected that. Thank you.
 
Holy crap. It was because of the escape. I would never have suspected that. Thank you.

Not specifically the escape's fault... it was the *combination* that caused it.

[try the version without quotes... it should also work]
 
Not specifically the escape's fault... it was the *combination* that caused it.

[try the version without quotes... it should also work]

Nope. Doesn't work without quotes but with escape. Also does not work without quotes and without escape. Is that weird?

But most annoyingly, the exclude file is in my Documents folder, which is in my home dir, yet ~ does not work. Why is that?
 
Nope. Doesn't work without quotes but with escape.
Unexpected. (maybe doubling\\ the escape would do it)


Also does not work without quotes and without escape. Is that weird?
As expected.


But most annoyingly, the exclude file is in my Documents folder, which is in my home dir, yet ~ does not work. Why is that?
Because of the quotes...

$ ls "~"
ls: ~: No such file or directory
$ ls '~'
ls: ~: No such file or directory


How long is your exclude list? [post it.]
I know a way to do it right within the script itself.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.