cancel
Showing results for 
Search instead for 
Did you mean: 

Backing up certain areas

 
Mark Parsons
Valued Contributor

Backing up certain areas

Hi,

Hope you can help.......

I want to run a backup that only backs up the root folder but not the data on certain mount points - not all mount points - only certain ones. Is there a "find" command that can be done where you can exclude listing specified folders? The find command would then be passed to a cpio command. Is there a tar command that would also do it.
Any suggestions gratefully received.
Kind Regards - Mark P.
7 REPLIES
James R. Ferguson
Acclaimed Contributor

Re: Backing up certain areas

Hi Mark:

If its the root directory that you want to backup ('/') but only selected mountpoints beneath, you could specify the '/' directory and the specific mountpoints you want:

# find / /usr /opt -xdev -print

This would find objects in '/' (including non-mountpoint directories like '/etc' and '/sbin') together with '/usr' and '/opt'.

The '-xdev' option tells 'find' not to cross mountpoints.

Depending on your requirements, you might also specify '-path ' or '-name ' and perhaps use '-prune'.

Regards!

...JRF...
DeafFrog
Valued Contributor

Re: Backing up certain areas

hi Mark ,

tar cvf testing.tar $(cat /home/user1/complete_path.txt)

where complete_path.txt contains the absolute path.You need to be careful while restoring this tar ball.

Regards,
DF
FrogIsDeaf
Ismail Azad
Esteemed Contributor

Re: Backing up certain areas

Hi,

The best way to do this is to create a graph file using and then fbackup files whatever you want. You can exclude /tmp /cdrom etc. and include /var / within the graph file and accordingly do incremental and diffrential backups.

Regards
Read, read and read... Then read again until you read "between the lines".....
Dennis Handly
Acclaimed Contributor

Re: Backing up certain areas

>DF: tar cvf testing.tar $(cat /home/user1/complete_path.txt)
>You need to be careful while restoring this tar ball.

This is where pax(1) shines:
pax -wv -f testing.tar < /home/user1/complete_path.txt
And pax's -s option can be used to change the absolute path.
S. Ney
Trusted Contributor

Re: Backing up certain areas

Hi,

I've used fbackup/frecover in the past. For an example:
fbackup -v -i /opt/oracle -e /opt/oracle/staging/forms/patch -f- | (cd /backup; frecover -Xrf-)

(moves everything from /opt/oracle but excludes /opt/oracle/staging/forms/patch and copied to /backup)

You can do a man of fbackup or a search through the forums. Here is one such thread:
http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=1427976
TwoProc
Honored Contributor

Re: Backing up certain areas

An example of root, opt, usr, and var mountpoints and nothing else.

find / /opt /usr /var -xdev -depth | cpio -oBdvxm > /dev/rmt/

or to another directory

find / /opt /usr /var -xdev -depth | cpio -pdmvux /

or to a cpio file

find / /opt /usr /var -xdev -depth | cpio pio -oBdvxm > myfile.cpio


The "x" options in there are to get device files, if you have any.
We are the people our parents warned us about --Jimmy Buffett
Mark Parsons
Valued Contributor

Re: Backing up certain areas

Thanks all - I have found the solution with "find"!!!!