Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

cp command 1

Status
Not open for further replies.

aixchild

Technical User
Nov 14, 2008
32
GB
I'm using the following to backup a directory

cp -Rp fromdir/* todir

It's worked bar the fact it does not copied links or .file (files beginning with dot - sorry!) files

Any ideas what parameter should be used. I've also tested with cp -rp but this has the same result.

For links should -h or -H be used, and how does this affect the link in the live directory (not great at understanding the full affect of copying/deleting links)

thanks

aixchild
 
I'm using the following to backup a directory"

^ There, you've just said it, use the backup command :)

find /dir/to/backup|backup -ivqf /dirtobackupto/filename.bak

restore -xdqvf /dirtobackupto/filename.bak

would restore it back exactly as it was.
 
nice one markuscj

tested and happy

thanks
 
Then award a star?

The internet - allowing those who don't know what they're talking about to have their say.
 
no need to create a backup file
just pipe backup process output to restore process
[tt]
cd /dir/to/backup
find . | backup -iqf- | (cd /dir/to/restore && restore -xdqf-)
[/tt]

HTH,

p5wizard
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top