Find the answer to your Linux question:
Results 1 to 2 of 2
Hello, I try to make a copy with a filter on directories not copied. I managed an early script by searching some forums but still there is a problem: the ...
  1. #1
    Just Joined!
    Join Date
    Oct 2009
    Posts
    2

    Reccursive copy with filter

    Hello,

    I try to make a copy with a filter on directories not copied.
    I managed an early script by searching some forums but still there is a problem: the copy in the target directory is with all parents of the source directory from the root, and I would like a recursive copy to preserve the tree
    For example after running:
    / home / leaderco / www/* -> / home / leaderfr / www/ home / leaderco / www/*
    and I want
    / home / leaderco / www/* -> / home / leaderfr / www/*

    here is the cmd with the filter path:
    Code:
    find /home/leaderco/www -path /home/leaderco/www/img -prune -o  -exec cp --parents {} /home/leadcom/www \;
    Thanks!

  2. #2
    Just Joined!
    Join Date
    Oct 2009
    Posts
    2
    No idea?

Posting Permissions

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