Question Help please with rsync64 --exclude-from options

peterh337

Honorable
May 5, 2016
155
0
10,690
Hello,

I am setting up rsync to do a backup of a unix server (nginx / centos). The rsync is running in a "dos box" under win7-64.

Someone else is looking after it but he's not available until next Monday.

There is a load of files which should not be backed up, notably some huge logfiles. Many files cannot be backed up anyway, but it doesn't matter; the job here is to just grab what can be grabbed.

I have been using rsync for years but never used the exclude file option.

There is conflicting info online about this. Some sites say each line needs to start with a minus sign e.g.

  • dev/.
  • sys/devices/.
  • *.log
  • proc/.

while others say just the filespecs

dev/.
sys/devices/.
*.log
proc/.

I have tried both and none work...

The rsync64 package is from here https://cygwin.com/install.html - the first link there.

The command line is

rsync --exclude-from \bats\exclude-file.txt -trvze "\cygwin64\bin\ssh -i /cygdrive... etc

What I am not sure is whether
--exclude-from \bats\exclude-file.txt
should instead be
--exclude-from /cygdrive/c/bats/exclude-file.txt
but I have tried that also :)

Very many thanks for any help.

The server runs a package written in Ruby on Rails which nobody seems to be able to maintain, other than by paying quite a bit of money to one of the very few people who know anything about Ruby. That's my other task...

I am also finding that there are thousands of files under /proc which get rsynced ok, with the data being "obviously" transferred, but they get written with a zero size. The destination is a Synology network drive, mapped under windows 7 as a drive letter.

Peter
 

peterh337

Honorable
May 5, 2016
155
0
10,690
I sort of solved it. There is no need for minus signs in the exclude file - contrary to much stuff online. Also I am not sure whether path substrings are parsed e.g. would
var/etc
exclude stuff like bin/var/etc/morestuff
Certainly /var/etc excludes everything in that path.
Also filespecs without a slash / work on all files so e.g.
*.log
will exclude those files.
 

TRENDING THREADS