Am Donnerstag, Januar 11, 2018 19:13 CET, "jdd@dodin.org" <jdd@dodin.org> schrieb:
Hello,
The web is filled with rsync examples, but I found none that fit my needs an find and rsync options are really hard to manage.
I have a tree of various files I use frequently, that get larger each year.
I want to archive them by year or range of years (example from start to 2010, from 2011 to 2012... at the end nothing must be ommitted
rsync can't do that. It has no options to select files by date alone. Try to create a second folder structure using find(1) and the option "-newermt" (see https://unix.stackexchange.com/questions/73268/how-to-move-the-files-based-o... for an example how to use a date range). Use hardlinks (ln(1) without -s) to "create" the files in the per-year directory structure, for example: -exec ln "{}" "/path/to/backup/2012/{}" \; Afterwards, you can use "find . -type f | sort > files.lst" on both folder structures and compare the two outputs to make sure you didn't miss anything. If the modification dates/permissions are different, use -printf to just include only name and file size. When you're sure, you can backup each year. Afterwards, you can use the find(1) commands which you used to create the links and replace -exec... with -delete to get rid of the saved files. The folders with the hardlinks, you can simply delete. Regards, -- Aaron "Optimizer" Digulla a.k.a. Philmann Dark "It's not the universe that's limited, it's our imagination. Follow me and I'll show you something beyond the limits." http://blog.pdark.de/ -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org