rsync syntax - how to add suffix to files to prevent overwriting?
DebianThis forum is for the discussion of Debian Linux.
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.
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.
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.
-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.
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?
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.)
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.