LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
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


Reply
  Search this Thread
Old 04-08-2015, 03:01 AM   #1
alaios
Senior Member
 
Registered: Jan 2003
Location: Aachen
Distribution: Opensuse 11.2 (nice and steady)
Posts: 2,203

Rep: Reputation: 45
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
 
Old 04-08-2015, 03:15 AM   #2
descendant_command
Senior Member
 
Registered: Mar 2012
Posts: 1,879

Rep: Reputation: 644Reputation: 644Reputation: 644Reputation: 644Reputation: 644Reputation: 644
You're already doing that.
 
Old 04-08-2015, 03:52 AM   #3
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
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
Code:
man rsync
 
Old 04-08-2015, 06:03 AM   #4
alaios
Senior Member
 
Registered: Jan 2003
Location: Aachen
Distribution: Opensuse 11.2 (nice and steady)
Posts: 2,203

Original Poster
Rep: Reputation: 45
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
 
Old 04-08-2015, 08:42 AM   #5
lleb
Senior Member
 
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora/Pop!_OS
Posts: 2,983

Rep: Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551
Quote:
Originally Posted by alaios View Post
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...
 
Old 04-08-2015, 12:32 PM   #6
jlinkels
LQ Guru
 
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195

Rep: Reputation: 1044Reputation: 1044Reputation: 1044Reputation: 1044Reputation: 1044Reputation: 1044Reputation: 1044Reputation: 1044
Quote:
Originally Posted by alaios View Post
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
 
Old 04-10-2015, 12:24 AM   #7
alaios
Senior Member
 
Registered: Jan 2003
Location: Aachen
Distribution: Opensuse 11.2 (nice and steady)
Posts: 2,203

Original Poster
Rep: Reputation: 45
Thanks guys
Alex
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
[SOLVED] X: "loading extension glx" "no screens found" "fatal server error" (w/ nvidia driver) Geremia Slackware 7 12-29-2014 11:00 AM
[SOLVED] "net rpc" "failed to connect to ipc$ share on" or "unable to find a suitable server" larieu Linux - General 0 11-09-2014 12:45 AM
unpredictable "delete" "move to trash" or "cut" file menu option dorianrenato Linux - General 3 11-28-2011 06:41 PM
Standard commands give "-bash: open: command not found" even in "su -" and "su root" mibo12 Linux - General 4 11-11-2007 10:18 PM
LXer: Displaying "MyComputer", "Trash", "Network Servers" Icons On A GNOME Desktop LXer Syndicated Linux News 0 04-02-2007 08:31 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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