- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: I want to copy a directory, but not all the fi...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-30-2005 09:02 PM
06-30-2005 09:02 PM
I want to copy a directory, but not all the files
I want to copy a directory to a other directoy, but not all the files. There ar about 2000 files.
I now the option cp -p -r directory > directory.
Who can help me!!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-30-2005 09:06 PM
06-30-2005 09:06 PM
Re: I want to copy a directory, but not all the files
find . -name xyz -type d -exec mkdir -p /destination/ {} \;
here you can have xyz as the child node to make it in one step.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-30-2005 09:11 PM
06-30-2005 09:11 PM
Re: I want to copy a directory, but not all the files
cd
find . \( ! -name . \) -type d -exec cp -r {}
or
cd
find . \( ! -name . \) -type d | xargs cp -r
Also refer to,
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=898151
hth.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-30-2005 11:58 PM
06-30-2005 11:58 PM
Re: I want to copy a directory, but not all the files
Can i use a exclude file???
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-01-2005 12:29 AM
07-01-2005 12:29 AM
Re: I want to copy a directory, but not all the files
find . -name "file_to_exclude" -prune
In addition to the above this will leave this file only.
If there are some more try the or option.
-o
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-01-2005 02:18 AM
07-01-2005 02:18 AM
Re: I want to copy a directory, but not all the files
cd source_dir
for direct in `ls -lrt|grep "^d"|awk '{print $9}'`
do
cp $direct targer_dir
done
Good Luck,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-01-2005 03:04 AM
07-01-2005 03:04 AM
Re: I want to copy a directory, but not all the files
fbackup | frecover works very well. A graph file for fbackup lets you specify both the includes and the excludes. Man fbackup, frecover for details.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-01-2005 03:30 AM
07-01-2005 03:30 AM
Re: I want to copy a directory, but not all the files
I have sometimes used the method, first creating a list of files with find, then edit the list and last, reading the list from a script which copies the files.
By the way, it is very common to use cpio together with find for copying files.
find . |cpio -pdvmux
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-01-2005 11:30 PM
07-01-2005 11:30 PM
Re: I want to copy a directory, but not all the files
I use your command, but to make first een file.index with "find . > file.index" en edit this one is ok.
But now a try to used it in your command.
"cat file.index |cpio -pdvmux /data" this seems to be working
I try to remove *.TCP from the file.index with a script command, so i can a create a sort of exclude file??.
Groet, Jos.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-02-2005 05:29 AM
07-02-2005 05:29 AM
Re: I want to copy a directory, but not all the files
How about using fbackup where you can specify list of files to be included or excluded, Check man pages of fbackup for more info.
Cheers !!!
eknath
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-02-2005 11:26 AM
07-02-2005 11:26 AM
Re: I want to copy a directory, but not all the files
A.Clay Stephenson & Eknath's suggestions
also are significant for me and at once
i thought these notes would be helpful to you
Good luck,
FBACKUP/FRECOVER
Things to remember about fbackup:
* fbackup MUST rewind the tape before beginning the backup and after
completing.
* a tape created with fbackup is only recoverable with frecover.
* a file listed in the index file (from option -rvNf) is not guaranteed
to be on the tape; this simply means that fbackup intended to back the
file up when it began the backup session.
Command Description
fbackup -vf /dev/rmt/0m -i / full system backup
fbackup -vf /dev/rmt/0m -i specifically include file/directory
/etc/hosts preceded by -i
fbackup -vf /dev/rmt/0m -i specifically include multiple
/etc/hosts -i /usr files/directories preceded by -i
fbackup -vf /dev/rmt/0m -e specifically exclude file/directory
/etc/hosts preceded by -e
fbackup -vf /dev/rmt/0m -g
graph_file_name backup from a graph file
frecover -xvf /dev/rmt/0m restore entire tape to originating
directory structure
restore entire tape to originating
frecover -xovf /dev/rmt/0m directory structure and overwrite any
existing files
cd /tmp restore entire tape to /tmp
frecover -xXvf /dev/rmt/0m (originating directory structure will
not be overwritten)
frecover -vf /dev/rmt/0m -I verify backup and read the index file
/tmp/index from the tape into a file called
/tmp/index
fbackup -vf /dev/rmt/0m 2>&1 log what is backed up, along with any
|tee /tmp/backup.log errors that occur
frecover -rNv -f /dev/rmt/0m 2>
/tmp/listing list of what is really on the tape
frecover -V /tmp/volume_headers
-f /dev/rmt/0m show volume headers on the tape
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-03-2005 08:58 AM
07-03-2005 08:58 AM
Re: I want to copy a directory, but not all the files
I want to thanks all de members who have reply, I try several optie from everyone.
Thanks, Jos.