Operating System - HP-UX
1821917 Members
3010 Online
109638 Solutions
New Discussion юеВ

Re: SAM automated backup problem

 
Ron Bromwell
Frequent Advisor

SAM automated backup problem

Hi all,
I have an automated backup created with SAM. I wanted to exclude any file with a .log or .dbf extension. I used a "*" as the wildcard for these files. i.e. exclude /home/oracle/*.log. This didn't work. The system still tries to backup the files, then errors because they are in use.
Is there a way, using SAM, to exclude files with some type of wildcard?
Thanks,
Ron
life's a journey, not a destination
7 REPLIES 7
Richard Darling
Trusted Contributor

Re: SAM automated backup problem

Richard Darling
Trusted Contributor

Re: SAM automated backup problem

Ron, you could use tar for your backups. That will give you the flexibility to exclude specific files.

Richard
Mark Vollmers
Esteemed Contributor

Re: SAM automated backup problem

Ron-

This might be a case where it would be easier to run the fbackup command from the prompt. Looking at the man page for fbackup, it will grab all the files in a graph file if you use the -g option. I have not used this myself, but it appears that you can speficy a text file that has all the files (full paths) that you want. Therefore, you can should be able to use the find command to grab everything without a .log or .dbf (using the not option and -name) to create the file list, and then send it to fbackup, all with a cron job. I'm just throwing out an idea here (can anyone out there confirm that this will work?). Good luck.

Mark
"We apologize for the inconvience" -God's last message to all creation, from Douglas Adams "So Long and Thanks for all the Fish"
boley janowski
Trusted Contributor

Re: SAM automated backup problem

Ron,

Something like this

find / -name *.log > /tmp/ex_log

for i in `cat /tmp/ex_log`
do
echo "e ${i}" >> /tmp/graph_file
done

vi /tmp/graph_file

#this should be a clean file with no comment lines in it. for the mount points you want to backup use a "i" it doesn't matter what order you put it in. example:

i /
i /home
i /usr
i /u01
e /tmp/xxx.log

you get the idea, save the file.

if you set it in cron for automation, put it in a script or just this entry with the fully qualified path.

/usr/sbin/fbackup -v -0 -g /tmp/graph_log -I /tmp/fbck_what -f /dev/rmt/0m

the "-I /tmp/fbck_what" will just create a log of what was backed up if you want it if not leave it out. Hope this helps.

Good Luck!1

James R. Ferguson
Acclaimed Contributor

Re: SAM automated backup problem

Hi Ron:

Mark's suggestion to build a graph file for 'fbackup' dynamically is exactly the approach I would use. Graphs are extremely flexible. You can (i)nclude whole directories and simultaneously (e)xclude selected subdirectories and/or files.

You could use 'find' or 'ls' with wildcard matching and or filter a list of files with 'awk' if you want to get fancy.

...JRF...
...JRF...
Ron Bromwell
Frequent Advisor

Re: SAM automated backup problem

Thanks all,
I don't generally administer this machine. I was trying to leave the automated backup through SAM.
I'll have to put each file is a separate exclusion
Ron
life's a journey, not a destination
boley janowski
Trusted Contributor

Re: SAM automated backup problem

yep if your insistant on SAM doing it for you that is what you will need to do, however the instructions i provided is basically the same thing, the only other thing you will need to do is:

crontab -e
00 23 * * 1-5 /usr/sbin/fbackup -v -0 -g /tmp/graph_log -I /tmp/fbck_what -f /dev/rmt/0m

then save
this will run 00 minute, 23 hour, 1-5 monday-friday - modify those the way you want (man cron for help) however i would suggest moving the /tmp/graph_log to a safer place like /usr/local/bin or something.