rsync exclude directory not working, when also scanning for only *.php files


Madmick
25/12/2015 9:47 am
HOME ยป Unix

Im trying to rsync all the .PHP and .HTML files from any directory inside of /home/ . However in /home/site2/public_html/cache_old/ there are .html files that i do not want to include in the sync (thus i want to exclude that directory and any of its sub-directories)

Here is the best rsync command i can come up with (after lots of testing and failures):

rsync -avv /home/ /ssd/rsyncPHPsFORmtree/ --include '*/'
--include '*.html' --include '*.php' --exclude
/site2/public_html/cache_old/* --exclude '*'

Im convinced that my rsync command is not formatted properly based upon this output from when rsync is running:

[sender] showing file
site2/public_html/cache_old/total_pages/s/e/a/r/c/page99.html because
of pattern *.html

[sender] showing file
site2/public_html/cache_old/total_pages/s/e/a/r/c/Page4.html because
of pattern *.html

[sender] showing file
site2/public_html/cache_old/total_pages/s/e/a/r/c/searchHe107.html
because of pattern *.html

[sender] showing file
site2/public_html/cache_old/total_pages/s/e/a/r/c/page18.html because
of pattern *.html

Thanks


Related to : rsync exclude directory not working, when also scanning for only *.php files
rsync exclude directory not working, when also scanning for only *.php files
25/12/2015 9:47 am by Madmick in Unix

Im trying to rsync all the .PHP and .HTML files from any directory inside of /home/ . However in /home/site2/public_html/cache_old/ there are .html files that i do not want to include in the sync (thus i want to exclude that directory and any of its sub-directories)

Here is the best


rsync recursively and exclude content of specific directory, not the directory
by Lepton87 in Unix
I have a directory tree like this :dir1/ file11 file12 file13 ... file1548216479524594dir2/ file21 file22dir3/ dir31/ file311 file312 dir32/ file321I would like to rsync entire directory tree but without content of directory dir1.If I use the basic rsync command :rsy
[all variants] rsync: exclude directory
by Nick Durcholz in Unix
Hi,
To exclude a directory from sync'ing using rsync, should I use
--exclude=dir
or
--exclude=dir/
or does it matter?
Thank you.
rsync exclude an entire directory
by Thaweesak Suksuwan in Unix
rsync exclude an entire directory
 
rsync -avz -e ssh --delete --exclude=/home/server/logs/
I want to exclude the logs directory from being transferred, that doesn't work. :confused: Anyone can help? Thx.

rsync exclude-from directory with space
2/12/2014 1:06 pm by google-app-engine in Unix

I am trying to exclude "Mendeley Desktop" directory for rsync.

The exclude-from= is as:

Downloads
*.o
*.iso
Dropbox
Documents/Mendeley Desktop

but rsync is still backing up the Mendeley Desktop.

How I can make rsync to ignore the directories with


How do I write an rsync exclude for a directory tree with names containing spaces?
20/11/2014 4:05 am by PrinceMyshkin in Unix

I'm trying to exclude a directory tree as part of an rsync command embedded in a bash script approximately like this:

$OPTIONS="-rl --exclude 'Some Parent Directory/Another
Directory'"

rsync $OPTIONS $SOURCEDIR a@b.com:/SomeTargetDir

My


How to exclude particular files from being copied by rsync?
by nishar7 in Unix
I am reading rsync docs, INCLUDE/EXCLUDE PATTERN RULES section. Following the rules explained there I would like to exclude the following folders and files:all .metadata foldersall *.DS_Store* filesSo, I am creating rules like:- .DS_Store.metadata/But files and folders are not excluded. What am I do
[all variants] Rsync vanished files, when using exclude=
by DeathReborn in Unix
As you hopefully know (otherwise you cannot help me), rsync first searches the filesystems for files to copy, before it continues to actually copy them.
Now, the problem is that when I backup our webserver, the /var/www rsync returns an error 24 status. Several files in there vanish.
The v
rsync : how to exclude hidden files and directories ?
by coding-style in Unix
Hello everybody !
I'm currently writing a backup script which uses the rsync command. I have to backup the entire directory structure and certain types of files. So, my rsync command looks like this :

rsync --include option does not exclude other files
by jcwagers in Unix

trying to rsync files of certain extension(*.sh), but the bash script below still transfer all the files, why?


from=/home/xxx
rsync -zvr --include="*.sh" $from/* root@$host:/home/tmp/

Privacy Policy - Copyrights Notice - Feedback - Report Violation - RSS 2014 © bighow.org All Rights Reserved .