1833875 Members
1832 Online
110063 Solutions
New Discussion

finding files only on /

 
SOLVED
Go to solution
uadm26
Super Advisor

finding files only on /

I need to backup files and directorys that i create in file system / but i don't want to copy the file system:
is something like this:

find / ???? | cpio -ocvB > /dev/DLTnn

Can u help me?
3 REPLIES 3
Pete Randall
Outstanding Contributor

Re: finding files only on /

Joel,

There's an example in the man page that seems to fit your requirements:

"Copy the root disk to a disk mounted on /Disk, skipping all mounted file systems below /. Note that -xdev does not cause / to be skipped, even though it is a mount point. This is because / is the starting point and -xdev only affects entries below starting points.

cd /; find . -xdev -print | cpio -pdm /Disk


Does that help?


Pete

Pete
Jose Mosquera
Honored Contributor
Solution

Re: finding files only on /

Hi,

Keeping your idea:
#find / -xdev|cpio -ocvB > /dev/DLTnn

Rgds.
Muthukumar_5
Honored Contributor

Re: finding files only on /

You can use -xdev option with find or -mountpoint option to select the files / directories under the same filesystem

-mountpoint is less preferred over -xdev option.

Comparative test:
==================

# find / -xdev -name "*" | wc -l
2343
# find / -mountstop -name "*" | wc -l
2343

They are same but mountpoint is provided for backward compatibility only.
Easy to suggest when don't know about the problem!