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 08-31-2013, 01:46 PM   #1
kilee
LQ Newbie
 
Registered: Nov 2009
Posts: 22

Rep: Reputation: 0
Question rsync help again


Hi folks,
I'd like to ask for some help checking if this rsync is correct, and how to add some extra arguments:
What I want to do is:
a) Backup all in disk N in disk Y. I'm actually consolidating different external hdd into a single one. So I'm repeating this script with different disks "N", all going to disk Y

b) I'd like to make backups if some files have the same name.
c) I do not want files under 10k
d) I've made a list of file type I need in listarsync.txt

I do not know if it is possible to delete the original file as soon as it is copied into the new location. That argument is missing.
Also, is it possible to delete duplicated files? with checksum or something like that?

rsync -r -t -v --progress --size-only -b --min-size=10k --include-from=/Users/X/Desktop/listarsync.txt --include=*/ --exclude=* /Volumes/N /Volumes/Y

One last thing. I it possible to "consolidate" all files in folders? Let's say, ald .docs go to folder/docs, al jpg's go to folder /jpg?

This would be great, but it's just a luxury .

Finally, is there a program that can run this?


Thanks for your help!
 
Old 08-31-2013, 01:53 PM   #2
jdkaye
LQ Guru
 
Registered: Dec 2008
Location: Westgate-on-Sea, Kent, UK
Distribution: Debian Testing Amd64
Posts: 5,465

Rep: Reputation: Disabled
Hi kilee,
What steps have you taken so far? The best plan is for you to try something out. You can get logs of info by typing this command at the prompt:
Code:
man rsync
That will help you get started. You can try to solve a) and see how far you get. If there's no problem then do b), and so on until you hit an obstacle. When you do, be sure to include all the details about what you've done so far: what commands you gave and what the system response was. You know the drill. Have fun.
jdk
 
Old 08-31-2013, 05:43 PM   #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
instead of --include, try just the --exclude-from=/path/to/file.txt and populate the excludes.txt like so:

Code:
- foo
+ bar
that will exclude foo, but include bar. you can also combine your options to make it easier to read the command:

Code:
rsync -aviS
instead of
Code:
rsync -a -v -i -S
if you want multiple destinations, then you will have to run 1 rsync command for each destination.
 
1 members found this post helpful.
Old 08-31-2013, 08:53 PM   #4
Beryllos
Member
 
Registered: Apr 2013
Location: Massachusetts
Distribution: Debian
Posts: 529

Rep: Reputation: 319Reputation: 319Reputation: 319Reputation: 319
Quote:
Originally Posted by kilee View Post
rsync -r -t -v --progress --size-only -b --min-size=10k --include-from=/Users/X/Desktop/listarsync.txt --include=*/ --exclude=* /Volumes/N /Volumes/Y
In the past, I have had a miserable time with rsync --include and --exclude filters, especially --exclude="*", but one thing that really helps with that is the -vv switch, which tells you how each filter acts on each file or directory. Here is a messages I posted in another thread that shows some examples of the output from -vv:
my LinuxQuestions post on rsync -vv in combination with --include and --exclude
Also please note that you should enclose the filter patterns in double quotation marks, for example:
Code:
rsync -avv --include="audiofiles" --include="*.mp3" --exclude="*" source/ destination/
 
1 members found this post helpful.
Old 09-01-2013, 08:14 AM   #5
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 kilee View Post
One last thing. I it possible to "consolidate" all files in folders? Let's say, ald .docs go to folder/docs, al jpg's go to folder /jpg?
That's a blatant copy of the question you already asked here: https://www.linuxquestions.org/quest...es-4175474913/ and that's neither necessary or appreciated.
 
Old 09-01-2013, 10:38 AM   #6
kilee
LQ Newbie
 
Registered: Nov 2009
Posts: 22

Original Poster
Rep: Reputation: 0
Hi Unspawn.
I honestly believe this question is better structured. And it was made after trying the advise in the other question.
So making a clearer question was necessary for me. The original idea of the post was getting help for checking the syntax of the command, and I got it.
I actually used your advise.
Thanks!
 
Old 09-01-2013, 12:53 PM   #7
jdkaye
LQ Guru
 
Registered: Dec 2008
Location: Westgate-on-Sea, Kent, UK
Distribution: Debian Testing Amd64
Posts: 5,465

Rep: Reputation: Disabled
And what progress have you made?
jdk
 
Old 09-06-2013, 07:54 PM   #8
kilee
LQ Newbie
 
Registered: Nov 2009
Posts: 22

Original Poster
Rep: Reputation: 0
It worked perfect at the end.
I just need to rename all backups, but that's another topic.

Thanks for your help.
 
  


Reply

Tags
rsync



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 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 execution issue with crontab - Have given full path to rsync too!! Prabagaran Linux - Server 6 04-15-2011 01:39 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
Windows Rsync Upload to Linux Rsync - permissions inspleak Linux - Software 0 10-12-2004 02:49 PM

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

All times are GMT -5. The time now is 04:56 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