Find the answer to your Linux question:
Results 1 to 2 of 2
I want to back up a file system, but omit all files over 10M and preserve the file structure. The closed I've managed to get is the command: find . ...
  1. #1
    Just Joined!
    Join Date
    Nov 2010
    Posts
    1

    cp -r omitting large files

    I want to back up a file system, but omit all files over 10M and preserve the file structure.
    The closed I've managed to get is the command:
    find . -size -10M -exec cp -d '{}' .~/CP_HERE/ ';'

    This finds all the required files, but copies them all to a single folder.
    Is there any was of doing this while preserving the file structure?

    cp -r omitting large files

  2. #2
    Linux Guru Irithori's Avatar
    Join Date
    May 2009
    Location
    Munich
    Posts
    2,096
    Code:
    rsync -a --max-size=10m <SOURCEDIR> <DESTINATIONDIR>
    You must always face the curtain with a bow.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...