Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
04-08-2015, 03:01 AM
|
#1
|
Senior Member
Registered: Jan 2003
Location: Aachen
Distribution: Opensuse 11.2 (nice and steady)
Posts: 2,203
Rep:
|
rsync that never "removes" or "deletes"
Hi all,
I would like to run rsync in a way that only add files or replaced edited files but it never removes something.
For example lets say that there is a hardware error on my source and instead of my 20.000 files only shows 2 (file system error, hard disk error whatever).
I do not want the rsync to say "Hey the 20.000 files now became 2. Remove the 20.000 and just keep the 2"
Right now I am calling rsync as :
rsync -rav -e ssh [source] [destination]
How I can improve my rsync to never remove something that is already copied?
I would like to thank you for your reply
Regards
Alex
|
|
|
04-08-2015, 03:15 AM
|
#2
|
Senior Member
Registered: Mar 2012
Posts: 1,882
|
You're already doing that.
|
|
|
04-08-2015, 03:52 AM
|
#3
|
Moderator
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
|
To expand on that, rsync only deletes files at the target location when it is run with one of the --delete options. More info on that with
|
|
|
04-08-2015, 06:03 AM
|
#4
|
Senior Member
Registered: Jan 2003
Location: Aachen
Distribution: Opensuse 11.2 (nice and steady)
Posts: 2,203
Original Poster
Rep:
|
Cool.. so if my source files for some reason are moved.. (Virus, system administration, whatever) I will still keep them in my back up external hard disk
Regards
Alex
|
|
|
04-08-2015, 08:42 AM
|
#5
|
Senior Member
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora/Pop!_OS
Posts: 2,992
|
Quote:
Originally Posted by alaios
Cool.. so if my source files for some reason are moved.. (Virus, system administration, whatever) I will still keep them in my back up external hard disk
Regards
Alex
|
yes, you might also want to consider multiple directories for backups too. IE: dow Mon, Tue, etc...
|
|
|
04-08-2015, 12:32 PM
|
#6
|
LQ Guru
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,196
|
Quote:
Originally Posted by alaios
Cool.. so if my source files for some reason are moved.. (Virus, system administration, whatever) I will still keep them in my back up external hard disk
Regards
Alex
|
Yes, but it has a downside. If you move or rename a large piece of data (say a directory) it is moved on your source disk, but duplicated on your backup disk.
As long as you take this into account there is no problem.
Since you should have at least 2 backup disks anyway (one disk might crash or get damaged during use) you can run rsync on purpose with the --delete switch when you are sure your second backup is sound.
jlinkels
|
|
|
04-10-2015, 12:24 AM
|
#7
|
Senior Member
Registered: Jan 2003
Location: Aachen
Distribution: Opensuse 11.2 (nice and steady)
Posts: 2,203
Original Poster
Rep:
|
Thanks guys
Alex
|
|
|
All times are GMT -5. The time now is 10:53 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|