LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 12-30-2013, 11:35 AM   #1
sedna06
LQ Newbie
 
Registered: Jul 2012
Posts: 23

Rep: Reputation: Disabled
Script issue Rsync


Hello LQ,

I have an Rsync script as shown below;

rsync -avztpog --delete --include='/home/jmoore/webroot/dav_files/web/*' --include='/home/jmoore/webroot/gallery/' --include='/home/jmoore/webroot/public/' --include='/home/jmoore/webroot/sharing/' --exclude='/home/jmoore/webroot/*' -e "ssh -l root" root@192.168.1.1://home/jmoore/ /home/jmoore/

what I would like it to do is to exclude certain directories and include certain ones, now it seems to run ok kinda but it does not pull down any new files that I have added on the 192.168.1.1 server.

any help would be appreciated.
 
Old 12-31-2013, 04:06 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by sedna06 View Post
(..)it does not pull down any new files that I have added on the 192.168.1.1 server.
Add "--stats -i" to your switches and check the output?
 
Old 12-31-2013, 11:51 AM   #3
lleb
Senior Member
 
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora/Pop!_OS
Posts: 2,983

Rep: Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551
a few things to note.

1. create an excludes.txt file and populate what you want and dont want with + -
2. root@192.168.1.1://home/jmoore/ is wrong, it should be: root@192.168.1.1:/home/jmoore

note the single / not double // this is not a URL you are connecting to for the ssh connection it is a file system pathway.
 
1 members found this post helpful.
Old 01-01-2014, 12:17 AM   #4
Beryllos
Member
 
Registered: Apr 2013
Location: Massachusetts
Distribution: Debian
Posts: 529

Rep: Reputation: 319Reputation: 319Reputation: 319Reputation: 319
I do not fully understand how the rsync --include and --exclude filters work, but I can tell you I have had much difficulty with them. In your case, I would guess the --exclude is over-riding the --include switches. Try running it with the -vv switch, which will tell you what each filter is doing, that is, how it acts on each file or directory. That may tell you why it is not making the transfer you expect.
 
Old 01-02-2014, 11:42 AM   #5
sedna06
LQ Newbie
 
Registered: Jul 2012
Posts: 23

Original Poster
Rep: Reputation: Disabled
Many thanks all for your help and comments
 
Old 01-06-2014, 07:07 AM   #6
sedna06
LQ Newbie
 
Registered: Jul 2012
Posts: 23

Original Poster
Rep: Reputation: Disabled
Hey All,

Still having issues my Rsync command will not exclude the directories that I have specified in the exclude files this is what I have

my exclude.txt

+ /home/./webroot/sharing/
+ /home/./webroot/public/
+ /home/./webroot/gallery/
+ /home/./webroot/dav_files/web/
- /home/./webroot/dav_files/*
- /home/./tmp/*
- /home/./webroot/*

my Rsync command

rsync -avvztpog --delete --exclude-from=exclude.txt root@192.168.1.2:/home/ /home/

any help would be appreciated
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Rsync backup issue glennbtn Linux - Newbie 5 03-27-2013 12:05 PM
[SOLVED] rsync execution issue with crontab - Have given full path to rsync too!! Prabagaran Linux - Server 6 04-15-2011 01:39 AM
Rsync issue robca Linux - Server 13 09-19-2009 11:41 AM
Rsync Issue deibertine Linux - Newbie 8 06-09-2009 11:49 AM
rsync issue fizeelinux Linux - Newbie 2 12-29-2008 09:47 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 04:54 AM.

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
Open Source Consulting | Domain Registration