Find the answer to your Linux question:
Results 1 to 3 of 3
i use the system restore cd to copy files from windows partition with windows installation. i have been using this when im inside t Code: cp -a * /mnt/"harddrive2" what ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Newbie
    Join Date
    May 2009
    Location
    Kitchener, Ontario, Canada
    Posts
    206

    copying files with with and exclude certain folders


    i use the system restore cd to copy files from windows partition with windows installation.

    i have been using this when im inside t
    Code:
    cp -a * /mnt/"harddrive2"
    what I would like to know if i can exclude files from being copied. I want to read the files to be excluded from a text file.


    OR

    Alternative method make i could make a bash script but then i have to figure out how to put it into systemrescuecd image before i burn it onto a cd.
    Last edited by donaldfarkas; 12-15-2011 at 02:11 PM. Reason: better title

  2. #2
    Trusted Penguin Irithori's Avatar
    Join Date
    May 2009
    Location
    Munich
    Posts
    3,391
    Have a look at
    Code:
    man rsync
    Especially the --exclude-from=FILE option.
    You must always face the curtain with a bow.

  3. #3
    Linux Newbie
    Join Date
    May 2009
    Location
    Kitchener, Ontario, Canada
    Posts
    206
    thank you for the info "rsync" is what im looking for

    currently my code is
    Code:
    rsync -a * --exclude-from=ex_files.txt _oldData
    now for my excludes do i need to add full path for folders?

    OR

    can I do a while card like
    Code:
    *\Temporary Internet Files\*
    ?

    OR

    if I put this in my excludes
    Code:
    Temporary Internet Files
    will it be smart enough to just exclude folder automatically?

Posting Permissions

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