Operating System - HP-UX
1833785 Members
2271 Online
110063 Solutions
New Discussion

Re: Copyinmg files from one filesystem to another

 
SOLVED
Go to solution
Madhu_17
Regular Advisor

Copyinmg files from one filesystem to another

Hi Friends,

I would like to copy files from one filesystem to another. i'm using the below command

#find . -depth -print | cpio -pdlmuv newdir

but i'm facing problem with the link files. file timestamp is updating with the current date. even the source and dest. directories sizes are mismatching. I'm not facing any problem with other directories time stamps and owner permissions.

Can anybody suggest me a better way to do this activity?


Thanks,
Madhu
7 REPLIES 7
Pete Randall
Outstanding Contributor

Re: Copyinmg files from one filesystem to another

Basically the only other way is to utilize your favorite backup/restore software. Take a fresh backup then restore it to the new location. Most (good) backup/restore packages allow you to restore to a new location yet keep the old dates.


Pete

Pete
Madhu_17
Regular Advisor

Re: Copyinmg files from one filesystem to another

We don't have that much outage window. We need to finish this in 1-2 hrs. so, we are planning to do this directly fm. one filesystem to another.

any suggestions please?
Zinky
Honored Contributor
Solution

Re: Copyinmg files from one filesystem to another

madhu,

cpio only preserves time stamps of all except link files and directories - the man pages should be clear on that.

If you want everyting to be "preserved" use vxdump/vxrestore:

vxdump 0f - /sourcefs| (cd /targetfs;vxrestore rf -)

Hakuna Matata

Favourite Toy:
AMD Athlon II X6 1090T 6-core, 16GB RAM, 12TB ZFS RAIDZ-2 Storage. Linux Centos 5.6 running KVM Hypervisor. Virtual Machines: Ubuntu, Mint, Solaris 10, Windows 7 Professional, Windows XP Pro, Windows Server 2008R2, DOS 6.22, OpenFiler
Madhu_17
Regular Advisor

Re: Copyinmg files from one filesystem to another

Hi Nelson,

Tha's Great... I didn't get that thought. This seems to be suitable command for my situation. get back to you, if i get any problems.

Thanks........ Madhu
Zinky
Honored Contributor

Re: Copyinmg files from one filesystem to another

Madhu,

Forget not to clean your target Filesystem -- either rm -r /tgtfilesys/* [except lost+found) or unmount the tgtfilesystem and mkfs ..

Hakuna Matata

Favourite Toy:
AMD Athlon II X6 1090T 6-core, 16GB RAM, 12TB ZFS RAIDZ-2 Storage. Linux Centos 5.6 running KVM Hypervisor. Virtual Machines: Ubuntu, Mint, Solaris 10, Windows 7 Professional, Windows XP Pro, Windows Server 2008R2, DOS 6.22, OpenFiler
Madhu_17
Regular Advisor

Re: Copyinmg files from one filesystem to another

I Got the answer which i was looking from this forum.
joinsiva
Advisor

Re: Copyinmg files from one filesystem to another


hi madhu,

how did u used the vxdump and vxrestore..

does it copied the link files also ???

pls tell me the syntax,

assume i want to copy filesystem /d03 to /snapd03

regards,
sivakumar p.