1832994 Members
2179 Online
110048 Solutions
New Discussion

cpio not copying .files

 
joe_91
Super Advisor

cpio not copying .files

Team:

find /home/mark -depth -newer /home/backup/junk |cpio -ocumBvd > /home/backup/back. This command is being used in a script and is not copying the .files. What would be wrong with this command? Please advice.

Thanks
Joe.
7 REPLIES 7
A. Clay Stephenson
Acclaimed Contributor

Re: cpio not copying .files

The most likely explanation is that the files are older than your reference file.
If it ain't broke, I can fix that.
John Poff
Honored Contributor

Re: cpio not copying .files

Hi Joe,

What are time stamps on the . files in /home/mark and on /home/backup/junk?

JP
S.K. Chan
Honored Contributor

Re: cpio not copying .files

None of the files timestamp are newer than "junk" perhaps ? Why don't you run this quickly ..
# find /home/mark -depth -newer /home/backup/junk -exec ls -l {} \;
to find out.
Darrell Allen
Honored Contributor

Re: cpio not copying .files

Hi Joe,

It skips your "dot" files, right? Your command syntax works for me. Are you sure the "dot" files are new enough to be included?

Darrell
"What, Me Worry?" - Alfred E. Neuman (Mad Magazine)
Ken Hubnik_2
Honored Contributor

Re: cpio not copying .files

I tested this command and the problem seems to be with the -newer option. If you take that option off the find does get the . files. So the test of the -newer option is the problem.
John Poff
Honored Contributor

Re: cpio not copying .files

I just tried it here and it works fine. I tried it both ways, with the -newer file newer than the .file, and the -newer file older than the .file, and it works correctly both ways (only finds the .file in the second case).

If you are making a regular backup of a user's home directory, probably the only changed dot file you will get is the .sh_history file, and maybe some of the Xwindows files (.dt dir, .Xauthority, etc.) if you are using that. I checked some of mine and they are all pretty old.

JP
joe_91
Super Advisor

Re: cpio not copying .files

Thanks Team.
I understand the command is OK.

Thanks again,
Joe.