LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   rsync (https://www.linuxquestions.org/questions/linux-newbie-8/rsync-4175559858/)

ac_kumar 11-25-2015 08:58 AM

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

pan64 11-25-2015 09:30 AM

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

ac_kumar 11-26-2015 02:31 AM

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

ac_kumar 11-26-2015 02:38 AM

i tried the above link its not copying the specific folder(update folder) from every folder
but thanks

frankbell 11-26-2015 07:23 PM

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

ac_kumar 11-27-2015 03:17 AM

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.

ac_kumar 11-27-2015 03:18 AM

thanks guys for replys

frankbell 11-27-2015 07:05 PM

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

ac_kumar 11-28-2015 08:14 AM

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.

ac_kumar 12-13-2015 02:15 AM

Done using :

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

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


All times are GMT -5. The time now is 03:11 PM.