LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 10-06-2014, 03:27 AM   #1
Bloodrule
LQ Newbie
 
Registered: Sep 2010
Posts: 5

Rep: Reputation: 0
rsync syntax - how to add suffix to files to prevent overwriting?


What is the syntax that would enable an rsync script to backup the same set of files to a new directory each time rysnc runs, or to the same directory but with each file being automatically renamed by adding a suffix of some sort?

In restoring, I want to be able to choose from old versions of files where necessary and not just have the latest, which may have overwritten the very text that I am looking for.
 
Old 10-06-2014, 04:30 AM   #2
descendant_command
Senior Member
 
Registered: Mar 2012
Posts: 1,876

Rep: Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643
Quote:
Originally Posted by man rsync
-b, --backup make backups (see --suffix & --backup-dir)
--backup-dir=DIR make backups into hierarchy based in DIR
--suffix=SUFFIX backup suffix (default ~ w/o --backup-dir)
maybe use the date as a suffix or DIR?

Last edited by descendant_command; 10-06-2014 at 04:31 AM.
 
Old 10-06-2014, 04:35 AM   #3
SAbhi
Member
 
Registered: Aug 2009
Location: Bangaluru, India
Distribution: CentOS 6.5, SuSE SLED/ SLES 10.2 SP2 /11.2, Fedora 11/16
Posts: 665

Rep: Reputation: Disabled
So why dont you start telling us what you have tried ?

Did you saw the man page ?

Did you checked "-backup-dir" and "--suffix" switches in rync ?

i think you got your hint to start with. Do let us know if you see any error while playing with these.
 
Old 10-06-2014, 04:38 AM   #4
Guttorm
Senior Member
 
Registered: Dec 2003
Location: Trondheim, Norway
Distribution: Debian and Ubuntu
Posts: 1,453

Rep: Reputation: 448Reputation: 448Reputation: 448Reputation: 448Reputation: 448
Hi

Other option is to not use rsync. It was really not written to handle things like this. The utiltiy rdiff-backup works like rsync, but handles changed/new/deleted files much better. You could make your own system with suffix or similar, but it's easy to make mistakes. Why not use proper tool?

http://www.nongnu.org/rdiff-backup/
 
1 members found this post helpful.
Old 10-06-2014, 10:30 AM   #5
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,784

Rep: Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214
The problem with rdiff-backup is that it has several outstanding bugs has been unmaintained since 2009. The problem with finding someone to take it over is that you need to be both a Python ace and also have good knowledge of Linux, Windows, and MAC filesystems. (No statistically significant relationship between close examination of the rdiff-backup Python code and increased risk of cancer of the eyeballs has been found. That's just folklore.)
 
1 members found this post helpful.
  


Reply



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
checking for suffix of object files... configure: error: cannot compute suffix of obj megras Linux - Kernel 1 10-15-2012 07:21 AM
[SOLVED] Overwriting free space or overwriting single files restored by photorec fcrok Linux - Security 22 09-15-2012 12:53 PM
[SOLVED] rsync keeps overwriting some unmodified files figure002 Linux - Software 4 01-08-2010 01:16 PM
rsync syntax to skip directory, but copy select files.. tnicol Linux - Software 3 07-24-2007 05:40 AM
prevent rsync from copying open files? bkeeper Linux - General 2 12-11-2006 04:16 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

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