Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - Server
User Name
Linux - Server This forum is for the discussion of Linux Software used in a server related context.


  Search this Thread
Old 09-05-2007, 08:28 PM   #1
LQ Newbie
Registered: Sep 2004
Distribution: Gentoo
Posts: 6

Rep: Reputation: 0
network backups with rsync, keep deleted files somewhere else?

I'm going to use rsync to make regular syncs of a drive in my workstation to my server, so obviously the two drives will be kept identical just in case.

I've got that setup and working well, but I'd like to be able to have rsync automatically copy any files that are to be deleted from the backup to another folder on another drive (because I deleted/renamed/whatever them from my workstation). I've checked out the manpage, and a few options stuck out at me:

       -b, --backup
              With this option, preexisting destination files are renamed as each file is trans-
              ferred or deleted.  You can control where the backup file goes and what  (if  any)
              suffix gets appended using the --backup-dir and --suffix options.

              Note  that if you don't specify --backup-dir, (1) the --omit-dir-times option will
              be implied, and (2) if --delete is also  in  effect  (without  --delete-excluded),
              rsync  will  add  a  "protect" filter-rule for the backup suffix to the end of all
              your existing excludes (e.g. -f "P *~").  This will prevent  previously  backed-up
              files  from  being deleted.  Note that if you are supplying your own filter rules,
              you may need to manually insert your own exclude/protect rule somewhere higher  up
              in  the  list so that it has a high enough priority to be effective (e.g., if your
              rules specify a trailing inclusion/exclusion of '*',  the  auto-added  rule  would
              never be reached).

              In  combination with the --backup option, this tells rsync to store all backups in
              the specified directory on the receiving side.  This can be used  for  incremental
              backups.   You  can additionally specify a backup suffix using the --suffix option
              (otherwise the files backed up in the specified directory will keep their original
I hoped this option was what I wanted and tried to use it by setting the -b flag then using '--backup-dir=/home/telexen/deleted-backups', but it didn't seem to do anything at all. Am I using it wrong or did I just interpret the description wrong? Is there another option that will allow me to do this?
Old 09-06-2007, 01:24 PM   #2
LQ Newbie
Registered: Sep 2004
Distribution: Gentoo
Posts: 6

Original Poster
Rep: Reputation: 0

Apparently I wasn't using --delete when I was testing to see if the backup option worked at all. Now that I try it with -b and --backup-dir=... it works fine.


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
Linux network - backups, logs, push files jantman Linux - Server 1 03-24-2007 03:08 PM
Rsync backups gabsik Linux - General 3 11-24-2006 07:14 PM
Rsync backups gabsik Linux - Networking 1 03-30-2006 10:31 AM
make rsync output deleted files? hawarden Linux - Software 8 03-18-2005 12:24 PM
Backups with rdiff - how different from rsync? Donboy Linux - Software 1 07-30-2004 10:54 PM > Forums > Linux Forums > Linux - Server

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

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration