On 01/11/2018 07:51 PM, jdd@dodin.org wrote:
Do you have a random, nested directory structure like
dir/a/file-from-2010 dir/a/file-from-2012 dir/a/x/file-from-2013 dir/b/c/file-from-2014 dir/file-from-2011
no, not there. I have a nested by date structure for the real "collections" (photos, videos), but not for the day to day files that are more fitted by other classification
you missed the 2nd half of the question: do you want to archive based on the timestamps of the files, or is the date part of the folders you're putting the files in? In the former case (timestamps), the solution may be a combination of of 'find' and 'rsync' (or 'mv'/'cp', depends); e.g. the following find the files with modification time in the year 2012: $ find . -newermt 2012-01-01 ! -newermt 2013-01-01 -ls So you could use that to move all those files into a 2012 folder (untested!): $ find . -type f -newermt 2012-01-01 ! -newermt 2013-01-01 -print0 \ | rsync -HAXaxi --from0 --files-from=- . /path2/archive-2012/. If you want to remove the files from the source directory, then I'd redirect the 'find' output to a file, and use it once for rsync and once for 'xargs -0 rm' as input. Have a nice day, Berny -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org