LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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 11-25-2015, 08:58 AM   #1
ac_kumar
Member
 
Registered: Aug 2011
Distribution: Ubuntu, Fedora
Posts: 175

Rep: Reputation: 9
rsync


hi a want to backup using rsync only particlular folder from every directory of a folder like

test1/-
test3/update
test4/update
test5/

to test2/ folder

i want that it should copy only folders update from test1/* directory
having its directory structure as
test2/
test3/update
test4/update

any suggestions
 
Old 11-25-2015, 09:30 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,842

Rep: Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309
what have you tried so far? do you have a script to work with? have you checked the man page of rsync? (have you tried google already?)
http://stackoverflow.com/questions/1...pecific-folder
 
Old 11-26-2015, 02:31 AM   #3
ac_kumar
Member
 
Registered: Aug 2011
Distribution: Ubuntu, Fedora
Posts: 175

Original Poster
Rep: Reputation: 9
yes i have read man page
and googled also
I tried the rsync include option as
rsync -av --include '*/' --exclude '*' test1/ test2/

but i only copies directories and not the specific ones
thanks for reply
 
Old 11-26-2015, 02:38 AM   #4
ac_kumar
Member
 
Registered: Aug 2011
Distribution: Ubuntu, Fedora
Posts: 175

Original Poster
Rep: Reputation: 9
i tried the above link its not copying the specific folder(update folder) from every folder
but thanks
 
Old 11-26-2015, 07:23 PM   #5
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,324
Blog Entries: 28

Rep: Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142
If you could provide the exact text of the script you are using and a sample of its output when you run rsync with the -v (verbose) argument, more specific suggestions might be possible.

This thread from the superuser forums might help: http://superuser.com/questions/39282...ers-with-rsync
 
Old 11-27-2015, 03:17 AM   #6
ac_kumar
Member
 
Registered: Aug 2011
Distribution: Ubuntu, Fedora
Posts: 175

Original Poster
Rep: Reputation: 9
so far the command
rsync -rv --include '*/' --include 'not*' --exclude '*' --prune-empty-dirs test1/ test2/

is working close as

test1/
test3/update/notfile
test4/update/notfile
test5/file

test2/
test3/update/notfile
test4/update/notfile
is working

but i want to copy only update folder and its contents with upper directory structure from every folder in test1 as:


test1/
test3/update/
test4/update/
test5/file

test2/
test3/update/
test4/update/

I want that rsync searches every folder of test1 for update folder and copy it with its contents to test2 with above root folders also

is it possible with rsync or i should use some scripts.
 
1 members found this post helpful.
Old 11-27-2015, 03:18 AM   #7
ac_kumar
Member
 
Registered: Aug 2011
Distribution: Ubuntu, Fedora
Posts: 175

Original Poster
Rep: Reputation: 9
thanks guys for replys
 
Old 11-27-2015, 07:05 PM   #8
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,324
Blog Entries: 28

Rep: Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142
There's a GUI frontend for rsync called BackinTime which I have heard spoken of favorably.

Perhaps giving it a try will help you get a handle on this. The Arch wiki has a good article about it: https://wiki.archlinux.org/index.php/Back_In_Time
 
Old 11-28-2015, 08:14 AM   #9
ac_kumar
Member
 
Registered: Aug 2011
Distribution: Ubuntu, Fedora
Posts: 175

Original Poster
Rep: Reputation: 9
thanks frankbell but i need it for scheduling backup so gui may not work
I think i have to look in scripting than but thanks anyways.
 
Old 12-13-2015, 02:15 AM   #10
ac_kumar
Member
 
Registered: Aug 2011
Distribution: Ubuntu, Fedora
Posts: 175

Original Poster
Rep: Reputation: 9
Done using :

find / -type d -name 'update folder' > files.txt

rsync -av --files-from=/path/to/files.txt source/ /destination
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Rsync-/usr/bin/rsync: Argument list too long sswaran Linux - Newbie 3 04-09-2015 07:18 AM
rsync giving ld.so.1: rsync: fatal: libiconv.so.2: open failed: error SunilEA Linux - Newbie 1 01-10-2014 01:24 PM
rsync solaris + ld.so.1: rsync: fatal: libiconv.so.2: open failed: xxx_anuj_xxx Solaris / OpenSolaris 25 02-23-2012 03:23 AM
[SOLVED] rsync fails in cron - ssh key prob for rsync? jonathansfl Linux - Server 6 12-09-2010 09:48 AM
Could I run rsync to download files from a server without rsync daemon? Richard.Yang Linux - Software 1 09-18-2009 04:08 AM

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

All times are GMT -5. The time now is 11:46 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
Open Source Consulting | Domain Registration