dhcpinform clogging my system.log
WPAD, or Web Proxy AutoDetection, is a protocol that was designed to convey Netscape's PAC format (Proxy Auto Config file) to web browsers automatically - without the user ever having to type a button. It never became an RFC proposed standard, but rather died as an Internet-Draft. I can only wonder what politics led to its demise...but it's full of wonderful hints of terrible flamewars, including the admission that the option code, 252, was 'assigned by the DHC WG chair.' Maybe I need to point out: option codes are never assigned by WG chairs...they are assigned only by IANA after standards action. Meanwhile, 252 is in the "site-local" space - it is not available for allocation! Not by a WG chair, not even by IANA. The site-local options were intended for site administrators (your network's sysadmin) to allocate - not manufacturers.
But its failure to reach RFC did not stop it from becoming the Internet's de facto standard in configuring web proxies. Consequently, whenever your Windows box boots, it tries WPAD to find proxies in order to get Windows Updates...Automatic Updates does this a few minutes after a box reboots. The first thing to do in WPAD is to try DHCP, so you might see Windows boxes try DHCPINFORMs first requesting option 252. They'll try several times until they get 252, and if they never get it, they move on to DNS. They'll query 'wpad.foo.example.com' if foo.example.com were the configured domain name, then 'wpad.example.com', then they give up. They're looking for A records, although the WPAD standard also describes TXT and SRV records (it never tries these). WPAD also describes using SLP after DNS, but I sincerely doubt anyone bothers.
The DNS method is essentially garbage being flooded out on the global Internet. Some older implementations seem to seek right down to 'wpad.'. It seems this is tried in others if no domain name were specified. Your ISP has to deal with wpad.ispname.com being queried all the time, and the rest of the Internet has to cope if the system has some garbled domain name...the query gets passed all the way down to the roots and up.
Edit 2008-08-13: It's also a security problem! Dan Kaminsky has reminded us that it is still, even with all our protections (short of DNSSEC), quite possible to manipulate DNS data. A ne'er do well that creates a cache entry for 'wpad.etc' in front of a horde of WPAD-capable clients can become the man in the middle for all their web content. You can filter for WPAD DNS queries, but it's easier to just make them stop querying for it.
The way to stop all of these clients that implement WPAD from querying DNS at all is to give them a poison pill at DHCP time; or heck configure WPAD at DHCP time and start providing a caching proxy service. I'll show you how to do both below the cut.
In ISC DHCP's dhcpd.conf, enter:
# WPAD definition
option wpad code 252 = text;
# Suppress WPAD activity - no cache, no DNS.
option wpad "\n\000";
# Configure a valid WPAD cache. The \n is required for Windows.
# All config below this line is optional.
#option wpad "http://www.example.com/wpad.pac\n";
# Special config for Windows ("MSFT 5.0") systems.
# Note this does not catch Windows CE.
class "MSFT" {
match if substring(option vendor-class-identifier, 0, 4) = "MSFT";
# They put 252 on the DHCPINFORM's, but not on the DHCPREQUEST's
# PRL. So we over-ride the PRL to include 252 = 0xFC, which will also
# suppress the DHCPINFORMS!
option dhcp-parameter-request-list =
concat(option dhcp-parameter-request-list, fc);
}
Now if you want to use a real cache instead of just poisoning WPAD to keep it from trying DNS, use something like the 'real cache' example in the above config snippet (commented out). Replace www.example.com with your handy web server. You have to configure the server to serve the wpad.pac file, and to set the right MIME type for it.
So on your webserver, first in apache's httpd.conf, enter in a MIME type pairing:
AddType application/x-ns-proxy-autoconfig .pac
Note that it appears x-ns-proxy-autoconfig is a deprecated MIME type for PAC files, but Windows (as of XP) will not digest a PAC file of the 'standard' MIME type.
Then, create a wpad.pac file. I recommend you start simple, see that it works, and then move onwards;
function FindProxyForURL(url, host)
{
return "PROXY 192.168.0.1:3128 ; DIRECT";
}
Note that this is javascript. You can use any javascript function to do arbitrary things; you can return multiple PROXY lines, or return different PROXY lines for different conditions (a classic example is to distribute queries to an array of caches based on some consistent policy; to improve cache coherence on each cache...all a* names to cache 1, all b* names to cache 2, ...).
Finally, I've found that although 'Microsoft Industry Updater' (automatic updates) will use the above by default, IE out-of-the-box on Windows XP needs to be told to find caches automatically. I don't know if there's another way to coax it into this state of affairs (some vendor-encapsulated option?). It rather defeats the purpose of automatic discovery if it takes manual intervention to enable it tho. If you know of a solution here, please leave a comment.
Edit: It seems something called GPO can be used to push a group policy that sets the 'Detect proxy Automatically'
Friday, May 25, 2012
Friday, May 11, 2012
Netapp Snapshot Management Cheat Sheet
This article explains the different commands related to Netapp Snapshot Management.
Creating a test volume of 10gb to perform snapshot related operations
Snapshot Rename
Snapshot Delete
Snap Scheduling
Snap Space Reservation
Snap Restore
Snap Delta
Snap reclaimable
Creating a test volume of 10gb to perform snapshot related operations
geekyfacts-filer > vol create testvol aggr 10gSnapshot Create
Creation of volume 'testvol' with size 10g on containing aggregate
geekyfacts-filer > df -h testvol
Filesystem total used avail capacity Mounted on
/vol/testvol/ 8192MB 1420KB 8190MB 0% /vol/testvol/
/vol/testvol/.snapshot 2048MB 0MB 2048MB 0% /vol/testvol/.snapshot
geekyfacts-filer >
geekyfacts-filer > snap list testvol
Volume testvol
working...
No snapshots exist.
geekyfacts-filer > snap create testvol testsnap
creating snapshot...
geekyfacts-filer > snap list testvol
Volume testvol
working...
%/used %/total date name
---------- ---------- ------------ --------
0% ( 0%) 0% ( 0%) Dec 19 01:02 testsnap
geekyfacts-filer >
Snapshot Rename
geekyfacts-filer > snap rename testvol testsnap snaptestgeekyfacts-filer > snap list testvol
Volume testvol
working...
%/used %/total date name
---------- ---------- ------------ --------
3% ( 3%) 0% ( 0%) Dec 19 01:02 snaptest
geekyfacts-filer >
Snapshot Delete
geekyfacts-filer > snap delete testvol snaptest
deleting snapshot...
geekyfacts-filer > snap list testvol
Volume testvol
working...
No snapshots exist.
geekyfacts-filer >
Snap Scheduling
Scheduling automatic snapshot to keep 2 weekly, 2 daily, 8 hourly(taken at hours 8,12,16,20) online.
geekyfacts-filer > snap sched testvol 2 2 8@8,12,16,20
geekyfacts-filer > snap sched testvol
Volume testvol: 2 2 8@8,12,16,20
geekyfacts-filer >
Snap Space Reservation
Default snapshot space reserve is 20% of the volume size
geekyfacts-filer > snap reserve testvol
Volume testvol: current snapshot reserve is 20% or 2097152 k-bytes.
geekyfacts-filer > df -h testvol
Filesystem total used avail capacity Mounted on
/vol/testvol/ 8192MB 1796KB 8190MB 0% /vol/testvol/
/vol/testvol/.snapshot 2048MB 0MB 2048MB 0% /vol/testvol/.snapshot
Changing the snapshot reserve to 5% of the volume size
geekyfacts-filer > snap reserve testvol 5
geekyfacts-filer > snap reserve testvol
Volume testvol: current snapshot reserve is 5% or 524288 k-bytes.
geekyfacts-filer > df -h testvol
Filesystem total used avail capacity Mounted on
/vol/testvol/ 9728MB 1796KB 9726MB 0% /vol/testvol/
/vol/testvol/.snapshot 512MB 0MB 512MB 0% /vol/testvol/.snapshot
geekyfacts-filer >
Snap Restore
Export and mount the testvol to put some contents in the volume.
geekyfacts-filer > exportfs -p rw=geekyfacts.com,root=geekyfacts.com /vol/testvol
Login to the server for which volume was exported(in our case geekyfacts.com)
[root@geekyfacts]# mkdir /test
[root@geekyfacts]# mount geekyfacts-filer:/vol/testvol /test
[root@geekyfacts]# df -h /test
Filesystem Size Used Avail Use% Mounted on
geekyfacts-filer:/vol/testvol
9.5G 1.8M 9.5G 1% /test
[root@geekyfacts]# cd /test
[root@geekyfacts]# touch file.before_snapshot
geekyfacts-filer > snap create testvol testsnap
creating snapshot...
geekyfacts-filer > snap list testvol
Volume testvol
working...
%/used %/total date name
---------- ---------- ------------ --------
0% ( 0%) 0% ( 0%) Dec 19 02:15 testsnap
[root@geekyfacts]# touch file.aftersnap
[root@geekyfacts]# ls -l
total 0
-rw-r--r-- 1 root root 0 Dec 19 02:16 file.aftersnap
-rw-r--r-- 1 root root 0 Dec 19 02:15 file.before_snapshot
Snapshot testsnap hold only file.before_snapshot
[root@geekyfacts]# ls .snapshot/testsnap/
file.before_snapshot
Volume restore using Snapshot
File Restore using Snapshot
geekyfacts-filer > snap restore -t vol -s testsnap testvol
WARNING! This will revert the volume to a previous snapshot.
All modifications to the volume after the snapshot will be
irrevocably lost.
Volume testvol will be made restricted briefly before coming back online.
Are you sure you want to do this? yes
You have selected volume testvol, snapshot testsnap
Proceed with revert? yes
Volume testvol: revert successful.
[root@geekyfacts]# ls
file.before_snapshot
[root@geekyfacts]# rm file.before_snapshot
rm: remove regular empty file `file.before_snapshot'? y
geekyfacts-filer> snap restore -t file -s testsnap -r /vol/testvol/file.before_snapshot /vol/testvol/file.before_snapshot
WARNING! This will restore a file from a snapshot into the active
filesystem. If the file already exists in the active filesystem,
it will be overwritten with the contents from the snapshot.
Are you sure you want to do this? yes
You have selected file /vol/testvol/file.before_snapshot, snapshot testsnap
It will be restored as /vol/testvol/file.before_snapshot
Proceed with restore? yes
[root@geekyfacts]# ls
file.before_snapshot
geekyfacts-file >#
Snap Delta
[root@geekyfacts]# touch file{1,2,3,4}
geekyfacts-file > snap create testvol testsnap1
creating snapshot...
geekyfacts-file > snap list testvol
Volume testvol
working...
%/used %/total date name
---------- ---------- ------------ --------
0% ( 0%) 0% ( 0%) Dec 19 02:23 testsnap1
19% (19%) 0% ( 0%) Dec 19 02:15 testsnap
geekyfacts-file > snap delta testvol
Volume testvol
working...
From Snapshot To KB changed Time Rate (KB/hour)
--------------- -------------------- ----------- ------------ ---------------
testsnap1 Active File System 56 20s 10080.000
testsnap testsnap1 424 0d 00:08 3173.388
Summary...
From Snapshot To KB changed Time Rate (KB/hour)
--------------- -------------------- ----------- ------------ ---------------
testsnap Active File System 480 0d 00:08 3449.101
geekyfacts-file>
Snap reclaimable
geekyfacts-file > snap reclaimable testvol testsnapProcessing (Press Ctrl-C to exit) .
snap reclaimable: Approximately 424 Kbytes would be freed.
Thursday, May 10, 2012
bprestore manual
NAME
bprestore - restores files from the NetBackup server
SYNOPSIS
/usr/openv/netbackup/bin/bprestore [-A | -B] [-K] [-l | -H | -y] [-r]
[-T] [-L progress_log] [-R rename_file] [-C client] [-D client]
[-S master_server] [-t class_type] [-c class] [-s mm/dd/yy
[hh:mm:ss]] [-e mm/dd/yy [hh:mm:ss]] [-w [hh:mm:ss]] [-k
"keyword_phrase"] -f listfile | filenames
DESCRIPTION
bprestore lets users restore a backed up or archived file or list of
files. You can also name directories to restore. If you include a
directory name, bprestore restores all files and subdirectories of
that directory.
By default, you are returned to the system prompt after bprestore is
successfully submitted. The command works in the background and does
not return completion status directly to you. The -w option lets you
change this behavior so bprestore works in the foreground and returns
completion status after a specified time period.
The bprestore command restores the file from the most recent backups
within the time period you specify, except for a true-image restore
(see the -T option description)."
Use the bplist command to display information on the files and
directories that were backed up or archived.
bprestore writes informative and error messages to a progress-log file
if you create the file prior to the execution of the bprestore command
and then specify the file with the -L progress_log option. If
bprestore cannot restore the requested files or directories, you can
use the progress log to find the reason for the failure.
For detailed troubleshooting information, create a directory named
/usr/openv/netbackup/logs/bprestore with public-write access.
bprestore then creates an activity log file in this directory.
In addition, if a nonroot user specifies USEMAIL = mail_address in
their $HOME/bp.conf file, NetBackup sends mail on the restore
completion status to mail_address. This message is sent when the
restore process is complete.
The following restrictions apply to bprestore:
o You can restore files and directories that you own and those
owned by other users if you have read access. You need write
access to another user's directories and files to restore that
user's files to their original location.
o The operating system restricts the number of files and
directories that you can specify on a single bprestore command
line. If this is a problem, use the -f option to restore the
files.
OPTIONS
-A | -B Specifies whether to restore from archives (-A) or backups
(-B). The default is -B.
-K Specifying this option causes bprestore to keep existing
files rather than writing over them when restoring files
with the same name. The default is to overwrite existing
files.
Note: The -l | -H | -y options apply only when restoring UNIX
files to a UNIX system.
-l | -H | -y
Specifying -l renames the targets of UNIX links by using the
-R rename_file option in the same way as when renaming
files.
Specifying -H renames UNIX hard links by using the -R
rename_file option in the same way as when renaming files.
Soft links are unchanged.
Specifying -y renames UNIX soft links by using the -R
rename_file option in the same way as when renaming files.
Hard links are unchanged.
See Example 5 in the EXAMPLES section.
-r Specifying this option restores raw partitions instead of
file systems.
-L progress_log
Specifies the name of an existing file in which to write
progress information.
For example: /home/tlc/proglog
The default is to not use a progress log.
-R rename_file
Specifies the name of a file with name changes for
alternate-path restores.
Use the following form for entries in the rename file:
change backup_filepath to restore_filepath
Where:
The file paths must start with / (slash)
The first backup_filepath that is matched is replaced with
the restore_filepath string. The default is to restore using
the original path.
For example, the following entry renames /usr/fred to
/usr/fred2:
change /usr/fred to /usr/fred2
-C client Specifies a client name to use for finding backups or
archives from which to restore files. This name must be as
it appears in the NetBackup catalog. The default is the
current client name.
-D client Specifies a destination client. This can be done by a root
user on the master server in order to direct the restored
files to a machine other than the client specified with the
-C option.
-S master_server
Specifies the name of the NetBackup server. The default is
the first server found in the /usr/openv/netbackup/bp.conf
file.
-t class_type
Specifies one of the following numbers corresponding to the
class type (the default is 0 on all clients except Apollos,
where it is 3):
0 = Standard
4 = Oracle
6 = Informix-On-BAR
7 = Sybase
10 = NetWare
13 = MS-Windows-NT
14 = OS/2
15 = MS-SQL-Server
16 = MS-Exchange-Server
19 = NDMP
Note: The following class types (Apollo-wbak, DataTools-SQL-
BackTrack, Auspex-FastBackup, SAP, DB2, FlashBackup, Split-
Mirror, and AFS) apply only to NetBackup DataCenter.
3 = Apollo-wbak
11 = DataTools-SQL-BackTrack
12 = Auspex-FastBackup
17 = SAP
18 = DB2
20 = FlashBackup
21 = Split-Mirror
22 = AFS
-C class Specifies the class for which the backups or archives were
performed.
-s mm/dd/yy [hh:mm:ss]
-e mm/dd/yy [hh:mm:ss]
Specifies the start and end date range for the listing. The
bprestore command restores only files from backups or
archives that occurred within the specified start and end
date range.
Note: The locale setting for the system affects the way you must
specify dates and times. See the NOTES section of this
command description.
-s specifies a start date and time for the restore window.
bprestore restores files only from backups or archives that
occurred at or after the specified date and time. Use the
following format:
mm/dd/yy [hh[:mm[:ss]]]
The valid range of dates are from 01/01/70 00:00:00 to
01/19/2038 03:14:07. The default start date is 01/01/70
00:00:00.
-e specifies an end date and time for the restore window.
bprestore restores only files in backups or archives that
occurred at or before the specified date and time. Use the
same format as for the start date and time.
The end backup date and time do not need to be exact, except
for a true-image restore (see the -T option description).
The bprestore command restores the file that has the
specified backup date and time or the file that is the most
recent backup preceding the end date and time. The default
is the current date and time."
If you do not specify either -s or -e, bprestore restores
the most recently backed up version of the file.
-T Specifies a true-image restore, where only files and
directories that existed in the last true-image backup are
restored. This option is useful only if true-image backups
were performed. If this option is not specified, all files
and directories meeting the specified criteria are restored,
even if they were deleted.
When the -T option is specified, the image requested must be
uniquely identified. Unique identification is accomplished
by using the -e option with seconds granularity. The -s
option, if any, is ignored. The seconds granularity of an
image can be retrieved by using the bplist command with the
-l and -Listseconds options.
-w [hh:mm:ss]
Causes NetBackup to wait for a completion status from the
server before returning you to the system prompt.
Note: The locale setting for the system affects the way you must
specify dates and times. See the NOTES section of this
command description.
You can optionally specify a wait time in hours, minutes,
and seconds. The maximum wait time you can specify is
23:59:59. If the wait time expires before the restore is
complete, the command exits with a timeout status. The
restore, however, still completes on the server.
Specifying 0 or not specifying a time, means wait
indefinitely for the completion status.
-k "keyword_phrase"
Specifies a keyword phrase for NetBackup to use when
searching for backups or archives from which to restore
files. The phrase must match the one that was previously
associated with backup or archive by the -k option of the
bpbackup or bparchive command.
You can use this option in place of or in combination with
the other restore options in order to make it easier to
restore your backups and archives. The following meta
characters can simplify the task of matching keywords or
parts of keywords in the phrase:
* matches any string of characters.
? matches any single character.
[ ] matches one of the sequence of characters specified
within the brackets.
[ - ] matches one of the range of characters separated by
the "-".
The keyword phrase can be up to 128 characters in length.
All printable characters are permitted including space (" "
) and period ("."). The phrase must be enclosed in double
quotes ("...") or single quotes (`...') to avoid conflict
with the UNIX shell.
The default keyword phrase is the null (empty) string.
-f listfile
Specifies a file (listfile) containing a list of files to be
restored and can be used instead of the filenames option. In
listfile, list each file path on a separate line.
The format required for the file list depends on whether the
files have spaces or newlines in the names.
To restore files that do not have spaces or newlines in the
names, use this format:
filepath
Where filepath is the path to the file that you are
restoring. For example:
/home
/etc
/var
To restore files that have spaces or newlines in the names,
use one of the following formats:
filepathlen filepath
filepathlen filepath start_date_time end_date_time
filepathlen filepath -s date_time -e date_time
Where:
filepath is the path to the file you are restoring.
filepathlen is the total number of characters in the file
path.
start_date_time and end_date_time are the decimal number of
seconds since 01/01/70 00:00:00.
datetime is the same as the command line (mm/dd/yy
[hh[:mm[:ss]]]). The start and end date and time specified
on the command line is used unless a line in listfile
overrides it. The dates may change from line to line.
The following is an example that uses filepathlen filepath:
5 /home
4 /etc
4 /var
19 /home/abc/test file
filenames Names one or more files to be restored and can be used
instead of the -f option.
Any files that you specify must be listed at the end,
following all other options. You must also specify absolute
file paths.
NOTES
The format that you must use for date and time values in NetBackup
commands depends on the locale setting. The examples in this command
description are for a locale setting of C.
If you are uncertain of the NetBackup command requirements for your
locale, enter the command with the -help option and check the usage.
For example:
/usr/openv/netbackup/bin/bprestore -help
USAGE: bprestore [-A | -B] [-K] [-l | -H | -y] [-r] [-T]
[-L progress_log] [-R rename_file] [-C client]
[-D client] [-S master_server] [-t class_type]
[-c class] [-k "keyword phrase"]
[-s mm/dd/yy [hh:mm:ss]] [-e mm/dd/yy [hh:mm:ss]]
[-w [hh:mm:ss]] -f listfile | filenames
Notice the month/day/year and hours:minutes:seconds requirements for
the -s and -e options. These are for a locale setting of C and can be
different for other locales.
For more information on locale, see the locale(1) man page for your
system.
EXAMPLES
Example 1
To restore a file from backups of /usr/user1/file1 that were
performed between 04/01/93 06:00:00 and 04/10/93 18:00:00, enter the
following (all on one line):
bprestore -s 04/01/93 06:00:00 -e 04/10/93 18:00:00 /usr/user1/file1
Example 2
To restore files listed in a file named restore_list by using the most
recent backups, enter the following:
bprestore -f restore_list
Example 3
To restore the directory /home/kwc from the backups that are
associated with a keyword phrase that contains "My Home Directory" and
use a progress log named /home/kwc/bkup.log, enter the following (all
on one line):
bprestore -k "*My Home Directory*" -L /home/kwc/bkup.log /home/kwc
Example 4
To restore the D drive on the Windows NT client slater from the
backups that are associated with a keyword phrase that contains "My
Home Dir" and use a progress log named /home/kwc/bkup.log, enter the
following (all on one line):
bprestore -k "*My Home Dir*" -C slater -D slater -t 13 -L
/home/kwc/bkup.log /D
Example 5
Assume you have a rename file named /home/kwc/rename on a UNIX client
and it contains the following:
change /home/kwc/linkback to /home/kwc/linkback_alt
To restore the hard link named /home/kwc/linkback to alternate path
/home/kwc/linkback_alt on that client, execute:
bprestore -H -R /home/kwc/rename /home/kwc/linkback
FILES $HOME/bp.conf /usr/openv/netbackup/logs/bprestore/log.mmddyy SEE ALSO bp(1), bparchive(1), bpbackup(1), bplist(1)
bprestore - restores files from the NetBackup server
SYNOPSIS
/usr/openv/netbackup/bin/bprestore [-A | -B] [-K] [-l | -H | -y] [-r]
[-T] [-L progress_log] [-R rename_file] [-C client] [-D client]
[-S master_server] [-t class_type] [-c class] [-s mm/dd/yy
[hh:mm:ss]] [-e mm/dd/yy [hh:mm:ss]] [-w [hh:mm:ss]] [-k
"keyword_phrase"] -f listfile | filenames
DESCRIPTION
bprestore lets users restore a backed up or archived file or list of
files. You can also name directories to restore. If you include a
directory name, bprestore restores all files and subdirectories of
that directory.
By default, you are returned to the system prompt after bprestore is
successfully submitted. The command works in the background and does
not return completion status directly to you. The -w option lets you
change this behavior so bprestore works in the foreground and returns
completion status after a specified time period.
The bprestore command restores the file from the most recent backups
within the time period you specify, except for a true-image restore
(see the -T option description)."
Use the bplist command to display information on the files and
directories that were backed up or archived.
bprestore writes informative and error messages to a progress-log file
if you create the file prior to the execution of the bprestore command
and then specify the file with the -L progress_log option. If
bprestore cannot restore the requested files or directories, you can
use the progress log to find the reason for the failure.
For detailed troubleshooting information, create a directory named
/usr/openv/netbackup/logs/bprestore with public-write access.
bprestore then creates an activity log file in this directory.
In addition, if a nonroot user specifies USEMAIL = mail_address in
their $HOME/bp.conf file, NetBackup sends mail on the restore
completion status to mail_address. This message is sent when the
restore process is complete.
The following restrictions apply to bprestore:
o You can restore files and directories that you own and those
owned by other users if you have read access. You need write
access to another user's directories and files to restore that
user's files to their original location.
o The operating system restricts the number of files and
directories that you can specify on a single bprestore command
line. If this is a problem, use the -f option to restore the
files.
OPTIONS
-A | -B Specifies whether to restore from archives (-A) or backups
(-B). The default is -B.
-K Specifying this option causes bprestore to keep existing
files rather than writing over them when restoring files
with the same name. The default is to overwrite existing
files.
Note: The -l | -H | -y options apply only when restoring UNIX
files to a UNIX system.
-l | -H | -y
Specifying -l renames the targets of UNIX links by using the
-R rename_file option in the same way as when renaming
files.
Specifying -H renames UNIX hard links by using the -R
rename_file option in the same way as when renaming files.
Soft links are unchanged.
Specifying -y renames UNIX soft links by using the -R
rename_file option in the same way as when renaming files.
Hard links are unchanged.
See Example 5 in the EXAMPLES section.
-r Specifying this option restores raw partitions instead of
file systems.
-L progress_log
Specifies the name of an existing file in which to write
progress information.
For example: /home/tlc/proglog
The default is to not use a progress log.
-R rename_file
Specifies the name of a file with name changes for
alternate-path restores.
Use the following form for entries in the rename file:
change backup_filepath to restore_filepath
Where:
The file paths must start with / (slash)
The first backup_filepath that is matched is replaced with
the restore_filepath string. The default is to restore using
the original path.
For example, the following entry renames /usr/fred to
/usr/fred2:
change /usr/fred to /usr/fred2
-C client Specifies a client name to use for finding backups or
archives from which to restore files. This name must be as
it appears in the NetBackup catalog. The default is the
current client name.
-D client Specifies a destination client. This can be done by a root
user on the master server in order to direct the restored
files to a machine other than the client specified with the
-C option.
-S master_server
Specifies the name of the NetBackup server. The default is
the first server found in the /usr/openv/netbackup/bp.conf
file.
-t class_type
Specifies one of the following numbers corresponding to the
class type (the default is 0 on all clients except Apollos,
where it is 3):
0 = Standard
4 = Oracle
6 = Informix-On-BAR
7 = Sybase
10 = NetWare
13 = MS-Windows-NT
14 = OS/2
15 = MS-SQL-Server
16 = MS-Exchange-Server
19 = NDMP
Note: The following class types (Apollo-wbak, DataTools-SQL-
BackTrack, Auspex-FastBackup, SAP, DB2, FlashBackup, Split-
Mirror, and AFS) apply only to NetBackup DataCenter.
3 = Apollo-wbak
11 = DataTools-SQL-BackTrack
12 = Auspex-FastBackup
17 = SAP
18 = DB2
20 = FlashBackup
21 = Split-Mirror
22 = AFS
-C class Specifies the class for which the backups or archives were
performed.
-s mm/dd/yy [hh:mm:ss]
-e mm/dd/yy [hh:mm:ss]
Specifies the start and end date range for the listing. The
bprestore command restores only files from backups or
archives that occurred within the specified start and end
date range.
Note: The locale setting for the system affects the way you must
specify dates and times. See the NOTES section of this
command description.
-s specifies a start date and time for the restore window.
bprestore restores files only from backups or archives that
occurred at or after the specified date and time. Use the
following format:
mm/dd/yy [hh[:mm[:ss]]]
The valid range of dates are from 01/01/70 00:00:00 to
01/19/2038 03:14:07. The default start date is 01/01/70
00:00:00.
-e specifies an end date and time for the restore window.
bprestore restores only files in backups or archives that
occurred at or before the specified date and time. Use the
same format as for the start date and time.
The end backup date and time do not need to be exact, except
for a true-image restore (see the -T option description).
The bprestore command restores the file that has the
specified backup date and time or the file that is the most
recent backup preceding the end date and time. The default
is the current date and time."
If you do not specify either -s or -e, bprestore restores
the most recently backed up version of the file.
-T Specifies a true-image restore, where only files and
directories that existed in the last true-image backup are
restored. This option is useful only if true-image backups
were performed. If this option is not specified, all files
and directories meeting the specified criteria are restored,
even if they were deleted.
When the -T option is specified, the image requested must be
uniquely identified. Unique identification is accomplished
by using the -e option with seconds granularity. The -s
option, if any, is ignored. The seconds granularity of an
image can be retrieved by using the bplist command with the
-l and -Listseconds options.
-w [hh:mm:ss]
Causes NetBackup to wait for a completion status from the
server before returning you to the system prompt.
Note: The locale setting for the system affects the way you must
specify dates and times. See the NOTES section of this
command description.
You can optionally specify a wait time in hours, minutes,
and seconds. The maximum wait time you can specify is
23:59:59. If the wait time expires before the restore is
complete, the command exits with a timeout status. The
restore, however, still completes on the server.
Specifying 0 or not specifying a time, means wait
indefinitely for the completion status.
-k "keyword_phrase"
Specifies a keyword phrase for NetBackup to use when
searching for backups or archives from which to restore
files. The phrase must match the one that was previously
associated with backup or archive by the -k option of the
bpbackup or bparchive command.
You can use this option in place of or in combination with
the other restore options in order to make it easier to
restore your backups and archives. The following meta
characters can simplify the task of matching keywords or
parts of keywords in the phrase:
* matches any string of characters.
? matches any single character.
[ ] matches one of the sequence of characters specified
within the brackets.
[ - ] matches one of the range of characters separated by
the "-".
The keyword phrase can be up to 128 characters in length.
All printable characters are permitted including space (" "
) and period ("."). The phrase must be enclosed in double
quotes ("...") or single quotes (`...') to avoid conflict
with the UNIX shell.
The default keyword phrase is the null (empty) string.
-f listfile
Specifies a file (listfile) containing a list of files to be
restored and can be used instead of the filenames option. In
listfile, list each file path on a separate line.
The format required for the file list depends on whether the
files have spaces or newlines in the names.
To restore files that do not have spaces or newlines in the
names, use this format:
filepath
Where filepath is the path to the file that you are
restoring. For example:
/home
/etc
/var
To restore files that have spaces or newlines in the names,
use one of the following formats:
filepathlen filepath
filepathlen filepath start_date_time end_date_time
filepathlen filepath -s date_time -e date_time
Where:
filepath is the path to the file you are restoring.
filepathlen is the total number of characters in the file
path.
start_date_time and end_date_time are the decimal number of
seconds since 01/01/70 00:00:00.
datetime is the same as the command line (mm/dd/yy
[hh[:mm[:ss]]]). The start and end date and time specified
on the command line is used unless a line in listfile
overrides it. The dates may change from line to line.
The following is an example that uses filepathlen filepath:
5 /home
4 /etc
4 /var
19 /home/abc/test file
filenames Names one or more files to be restored and can be used
instead of the -f option.
Any files that you specify must be listed at the end,
following all other options. You must also specify absolute
file paths.
NOTES
The format that you must use for date and time values in NetBackup
commands depends on the locale setting. The examples in this command
description are for a locale setting of C.
If you are uncertain of the NetBackup command requirements for your
locale, enter the command with the -help option and check the usage.
For example:
/usr/openv/netbackup/bin/bprestore -help
USAGE: bprestore [-A | -B] [-K] [-l | -H | -y] [-r] [-T]
[-L progress_log] [-R rename_file] [-C client]
[-D client] [-S master_server] [-t class_type]
[-c class] [-k "keyword phrase"]
[-s mm/dd/yy [hh:mm:ss]] [-e mm/dd/yy [hh:mm:ss]]
[-w [hh:mm:ss]] -f listfile | filenames
Notice the month/day/year and hours:minutes:seconds requirements for
the -s and -e options. These are for a locale setting of C and can be
different for other locales.
For more information on locale, see the locale(1) man page for your
system.
EXAMPLES
Example 1
To restore a file from backups of /usr/user1/file1 that were
performed between 04/01/93 06:00:00 and 04/10/93 18:00:00, enter the
following (all on one line):
bprestore -s 04/01/93 06:00:00 -e 04/10/93 18:00:00 /usr/user1/file1
Example 2
To restore files listed in a file named restore_list by using the most
recent backups, enter the following:
bprestore -f restore_list
Example 3
To restore the directory /home/kwc from the backups that are
associated with a keyword phrase that contains "My Home Directory" and
use a progress log named /home/kwc/bkup.log, enter the following (all
on one line):
bprestore -k "*My Home Directory*" -L /home/kwc/bkup.log /home/kwc
Example 4
To restore the D drive on the Windows NT client slater from the
backups that are associated with a keyword phrase that contains "My
Home Dir" and use a progress log named /home/kwc/bkup.log, enter the
following (all on one line):
bprestore -k "*My Home Dir*" -C slater -D slater -t 13 -L
/home/kwc/bkup.log /D
Example 5
Assume you have a rename file named /home/kwc/rename on a UNIX client
and it contains the following:
change /home/kwc/linkback to /home/kwc/linkback_alt
To restore the hard link named /home/kwc/linkback to alternate path
/home/kwc/linkback_alt on that client, execute:
bprestore -H -R /home/kwc/rename /home/kwc/linkback
FILES $HOME/bp.conf /usr/openv/netbackup/logs/bprestore/log.mmddyy SEE ALSO bp(1), bparchive(1), bpbackup(1), bplist(1)
How to Import Images in NetBackup
Step by step procedure on how to import NetBackup
backup images via the NetBackup Administration Console GUI.
Details:
Importing media requires a 2 step process, first a Phase
1 import must be run followed by a Phase 2 import.
- The Phase 1 import
procedure assigns the media to the Media Server in the EMM database, and
reads the media to create a HEADER file in the ImageDB for each backup found. If
the backup image being imported spans media, a Phase 1 needs to be performed on
ALL media before running the Phase 2.
NOTE: The Phase 1 option is referred
too as "Initiate Import" in the NetBackup Administration GUI.
- The Phase 2 reads the media more
thoroughly and creates the FILES file in the images database. The FILES file
contains a list of all the files contained in the backup image.
The screen shots below will help identify the steps involved with importing a image.
1. Under the Catalog section of the console, select Actions -> Initiate Import.
2. Enter the Media ID and Media Server in the Initiate Import box.
3. After the Phase 1 has been completed on all media, select the criteria in which to search for backup
image(s) produced during the phase 1 import. The main search parameters will be the media ID and/or a date time range covering the backup date. Press Search Now to find the backup image(s) available for Phase 2 import.
4. Select/highlight one or more of the backup image(s) available for importing, right click on the backup
image(s) and select Import (Do not select "initiate import" again). This section of the import may take as long as the original backup (perhaps longer if the backups were multiplexed).
Catalog Recovery Procedure
DOCUMENTATION: Catalog recovery procedure: an example
of disaster recovery.
Details:
Sample Catalog recovery procedure
This is only an example of procedures used. Not all steps are required and may not be applicable to all situations.
These directions assume that NetBackup has already been installed on the DR (disaster recovery) server.
Note: these instructions describe a full recovery of the master for redeployment into production.
1. Load media into DR site robot.
For safety, only load the catalog tape initially.
Alternately, load all media as write protected.
2. Validate the bp.conf and vm.conf (if applicable) configuration files.
Additional things to check:
This is only an example of procedures used. Not all steps are required and may not be applicable to all situations.
These directions assume that NetBackup has already been installed on the DR (disaster recovery) server.
Note: these instructions describe a full recovery of the master for redeployment into production.
1. Load media into DR site robot.
For safety, only load the catalog tape initially.
Alternately, load all media as write protected.
2. Validate the bp.conf and vm.conf (if applicable) configuration files.
Additional things to check:
- Check /usr/openv/volmgr/vm.conf for a MEDIA_ID_BARCODE_CHARS entry, if it is needed.
- Check /usr/openv/netbackup/db/config for the touch files NUMBER_DATA_BUFFERS and SIZE_DATA_BUFFERS.
- Check /usr/openv/netbackup for the touch file NET_BUFFER_SZ.
Uncheck all servers except the master server.
Run the wizard to configure the devices.
On the first result dialog, check for any limitations.
To change from the default drive densities, if desired:
In the Drag and Drop Configuration dialog, select the drive and click on the Properties button. Verify the Drive Density.
Repeat this for each drive.
In the Configure Storage Unit dialog, select the storage unit and click Properties to verify the storage unit settings.
4. Run an inventory of the robot.
Preview the inventory and verify the media type is correct.
Make note of the barcodes and any changes from the production site, as different robots can return different barcodes for the same tape. For instance, LTO tapes can have "L#" on the end of the barcode. This can be disabled via the robot console option for short labels.
Update the volume configuration.
5. Add the following line to bp.conf:
RESOURCE_MONITOR_INTERVAL = 3600
This will change media server polling from 10 minutes to 1 hour.
6. Make copies of the DR environment bp.conf and vm.conf files
# cd /usr/openv/netbackup
# cp bp.conf bp.conf.dr
# cd ../volmgr
# cp vm.conf vm.conf.dr
7. Recover the entire catalog.
This is performed from the GUI on the master server. Always log in to the Java GUI using the short hostname, as the fully qualified domain name may not match the production site.
Note: Optionally, the catalog recovery can be performed from the command line:
# /usr/openv/netbackup/bin/admincmd/bprecover -wizard
8. Manually deactivate all backup policies.
From the GUI, select all policies, right click and select Deactivate. This may take a while.
Be sure that all policies are deactivated before proceeding.
9. Shut down NetBackup.
# /usr/openv/netbackup/bin/bp.kill_all
Verify with bpps -x that only /opt/VRTSpbx/bin/pbx_exchange is running.
10. Prep the bp.conf and vm.conf configuration files.
Copy bp.conf and vm.conf to bp.conf.prod and vm.conf.prod:
# cd /usr/openv/netbackup
# cp bp.conf bp.conf.prod
# cd ../volmgr
# cp vm.conf vm.conf.prod
Then, copy back the bp.conf.dr and vm.conf.dr to bp.conf and vm.conf:
# cd /usr/openv/netbackup
# cp bp.conf.dr bp.conf
# cd ../volmgr
# cp vm.conf.dr vm.conf
Verify that the hostnames of any remote Windows console servers are included in the bp.conf with a SERVER entry.
11. Make sure bp.conf and vm.conf are configured correctly to reflect DR environment.
Append FORCE_RESTORE_MEDIA_SERVER entries to bp.conf for each media server not present at DR that were used to do backups in production. The syntax of these entries is as follows:
FORCE_RESTORE_MEDIA_SERVER =
12. Perform a partial startup nbemm.
This will allow modification of the nbemm database without the job manager running and kicking off jobs.
# /usr/openv/netbackup/bin/nbdbms_start_stop start
# /usr/openv/netbackup/bin/nbemm
Run bpps -x to verify that nbemm and NB_dbsrv are running
13. Deactivate all media servers not participating in the DR.
# /usr/openv/netbackup/bin/admincmd/nbemmcmd -updatehost -machinename
Be sure to execute this command against every unavailable media server.
14. Start nbevtmgr and bpdbm.
# /usr/openv/netbackup/bin/nbevtmgr
# /usr/openv/netbackup/bin/initbpdbm
Again, run bpps -x to verify that bpdbm and nbevtmgr are running.
15. Delete all storage units.
This step is optional, but will give a cleaner experience. Either use the GUI or the command line.
From the command line:
# /usr/openv/netbackup/bin/admincmd/bpstulist -go | cut -f 1 -d ' ' > /tmp/stu_groups
# /usr/openv/netbackup/bin/admincmd/bpstulist | cut -f 1 -d ' ' > /tmp/stu_list
# for i in `cat /tmp/stu_groups` ; do echo "/usr/openv/netbackup/bin/admincmd/bpstudel -group $i" ; done >> /tmp/delete_stu_groups
# for i in `cat /tmp/stu_list` ; do echo "/usr/openv/netbackup/bin/admincmd/bpstudel -label $i" ; done >> /tmp/delete_stus
# sh /tmp/delete_stu_groups
Note: Be sure to delete storage unit groups first prior to deleting storage units!
16. Delete all tape devices from the command line.
# /usr/openv/netbackup/bin/admincmd/nbemmcmd -deletealldevices -allrecords
Verify no devices are returned:
# /usr/openv/volmgr/bin/tpconfig -emm_dev_list -noverbose
17. Stop and restart NetBackup.
# /usr/openv/netbackup/bin/bp.kill_all
Use bpps -x to verify that only /opt/VRTSpbx/bin/pbx_exchange is running.
# /usr/openv/netbackup/bin/bp.start_all
...
# bpps -x
NB Processes
------------
root 13809 13808 0 15:05:07 ? 0:00 /usr/openv/netbackup/bin/nbproxy dblib nbjm
root 13775 1 0 15:05:03 ? 0:00 /usr/openv/netbackup/bin/bpcompatd
root 13786 1 1 15:05:04 ? 0:00 /usr/openv/netbackup/bin/bpdbm
root 13757 1 0 15:05:01 ? 0:00 /usr/openv/netbackup/bin/nbrb
root 13747 1 0 15:04:59 ? 0:00 /usr/openv/netbackup/bin/nbevtmgr
root 13795 13786 0 15:05:05 ? 0:00 /usr/openv/netbackup/bin/bpjobd
root 13856 1 0 15:05:12 ? 0:00 /usr/openv/netbackup/bin/nbsvcmon
root 13813 1 1 15:05:08 ? 0:01 /usr/openv/netbackup/bin/nbstserv
root 13811 13810 1 15:05:07 ? 0:01 /usr/openv/netbackup/bin/nbproxy dblib nbpem
root 13818 1 1 15:05:09 ? 0:01 /usr/openv/netbackup/bin/nbrmms
root 13752 1 2 15:05:00 ? 0:02 /usr/openv/netbackup/bin/nbemm
root 13808 13797 0 15:05:07 ? 0:00 sh -c "/usr/openv/netbackup/bin/nbproxy" dblib nbjm
root 13770 1 1 15:05:02 ? 0:01 /usr/openv/netbackup/bin/bprd
root 13844 1 0 15:05:11 ? 0:00 /usr/openv/netbackup/bin/nbsl
root 13797 1 0 15:05:05 ? 0:00 /usr/openv/netbackup/bin/nbjm
root 13810 13804 0 15:05:07 ? 0:00 sh -c "/usr/openv/netbackup/bin/nbproxy" dblib nbpem
root 13804 1 0 15:05:06 ? 0:00 /usr/openv/netbackup/bin/nbpem
root 13742 1 0 15:04:57 ? 0:02 /usr/openv/db/bin/NB_dbsrv
MM Processes
------------
root 13783 1 1 15:05:04 ? 0:01 vmd -v
Shared Symantec Processes
-------------------------
root 142 1 1 16:46:54 ? 0:52 /opt/VRTSpbx/bin/pbx_exchange
18. In the GUI, run the device configuration wizard to configure shared drives.
Uncheck all servers except the robot control host.
Run the wizard to configure the devices
On the first result dialog, check for any limitations
To change from the default drive densities, if desired:
In the Drag and Drop Configuration dialog, select the drive and click on the Properties button. Verify the Drive Density.
Repeat for each drive.
In the Configure Storage Unit dialog, select the storage unit and click Properties to verify the storage unit settings.
If needed, repeat the process for any additional servers.
Using the Device Monitor, make sure that no drives have the RESTART bit set. Restart ltid on the servers if needed.
19. Run the robot inventory.
Before running the inventory, use the GUI to verify all the recovery media are set to non-robotic.
If they are not, select all robotic media, right click and select Move. Make sure Volume is in a robotic library is unchecked.
Note: The volume group may be "---" - this is okay.
Hit OK.
Make note of the barcodes and any changes from the production site (the presence of the "L#" tag). The hardware should be able to toggle the "L#" tag (long vs. short labels). If that is not possible, the barcode of the media can be changed with the following command:
# /usr/openv/volmgr/bin/vmchange -barcode
20. Verify that restores work.
More information on DR procedures can be found in Chapter 7 of the NetBackup Troubleshooting Guide (linked below).
Netbackup Commands
http://www.bettssoftware.com/docs/tips-netbackup.html
Find the tape(s) used (above procedure using bpimagelist)
cd /usr/openv/netbackup/db/jobs/done
Run the following script and redirect it's output to a text file:
for file in `grep MOUNTING *|grep <MEDIA_ID>|awk '{print $1}'|sed 's/:MOUNTING//'`
do
echo $file
grep PATH_WRITTEN $file|awk '{print $3}'
echo " "
echo "==========================================End of Image======================================"
echo " "
done
This process works for NBU V3.4:
Inventory the Robot
Server Logfile directories:
.Logging will only occur if these directories are created. These directories will generate a lot of data and should be deleted when no longer necessary.
To increase the amount of logging information set VERBOSE=2 in /usr/open/netbackup/bp.conf (default is VERBOSE=1)
acsd
vmd
bpclinfo <class> -L --> displays info about a class
vmpool - volume pools
vmpool -listall
vmpool -listscratch
bplabel -ev <media id> -d hcart
bpbackup db --> backs up the catalog
bpclclients <policy> --> lists the clients for a particular policy (class)
No Backups are running:
Create a media id
It could be a couple things. Mostly DNS, bp.conf, or something stupid. On
the client run this command
/usr/openv/netbackup/bin/bpclntcmd -pn
/usr/openv/netbackup/bin/bpclntcmd -server "server name"
/usr/openv/netbackup/bin/bpclntcmd ip "ip_address"
One of these usually fails and your able to fix it right off
1074 ./bpclntcmd -hn corpbu1
1075 ./bpclntcmd -ip 10.194.1.129
1076 ping 10.194.1.129
1077 ./bpclntcmd -hn corpldv1
1078 ./bpclntcmd -hn corpbu1.corporate.vox.net
1079 ping corpldv1
1080 ./bpclntcmd -ip 10.194.1.120
Must be able to resolve correctly from the master server and the client or it will not work!!!
When using bprestore to recover files and directories, occasionally there will be a need to exclude some of the files and directories. Bprestoreprovides this facility with the aid of the exclamation mark ( ! ). The exclamation mark goes before the file or directory name to be excluded. It can be added from the command line, or placed within a separate file list.
Note: This procedure is not valid when doing Network Data Management Protocol (NDMP) restores.
Command Example 1:This example would restore the "dir" path. However, it will omit the "dir2" directory.
UNIX:/usr/openv/netbackup/bin/bprestore -C <client_name> -L <log_filename> -t <policy_type> /dir !/dir/dir1/dir2
Windows (from the NetBackup\bin directory):
bprestore -C< client_name> -L <log_filename> -t <policy_type> C:\dir !C:\dir\dir1\dir2
Command Example 2:A file list file is more useful when there is a long list of files and directories. The command line for bprestore, using a file list would look like:
UNIX:/usr/openv/netbackup/bin/bprestore -C <client_name> -L <log_filename> -t <policy_type> -f <filelist_filename>
Windows (from theNetBackup\bin directory):
bprestore -C <client_name> -L <log_filename> -t <policy_type> -f< filelist_filename>
File ListsBelow is a very simple example of how a file list file would look:
If there are any spaces between the file or directory names, the character count must appear before the pathname. The file list would then look similar to the following:
restore to an alternate path on the client
1. Create a rename file
Use the following form for the entries in the rename file:
change backup_filepath to restore_filepath
The file paths must start with / (slash).
For example, the following entry in the rename file named /home/admin/rename will restore /usr/Dir1 to /usr/Dir2.
change /usr/Dir1 to /usr/Dir2
2. The syntax for the bprestore command.
/usr/openv/netbackup/bin/bprestore -l -R rename_file filenames
For example, the following command will restore directories and files under /usr/Dir1 to /usr/Dir2.
/usr/openv/netbackup/bin/bprestore -l -R /home/admin/rename /usr/Dir1
The -l specifies that all UNIX hard and soft links be changed.
http://linuxdynasty.org/69/netbackup-troubleshooting-how-to/
Netbackup Cheat Sheet (based on pre-NBU 6.0 information)
http://www.datadisk.co.uk/html_docs/veritas/veritas_netbackup_cs.htm
Master Server Daemons/Processes
Media Server Daemons/Processes
Catalogs
Log and Information Files
Server Commands
Volume Commands
Media commands
Tape/Robot commands
Archiving Commands
Client commands
Reports
(<start_date> and <end_date> syntax: MM/DD/YY
<start_time> and <end_time> syntax: hh:mm:ss
<media_id> is the six-character media identification number)
* bptestbpcd to test client connectivity as from NBU 6.0 and use bpclntcmd to test hostname lookup.
* For NBU 7.0+, All device config for master and media server(s) as well as media and volume catalogs now reside in the EMM database on the master server
Starting and Stopping Netbackup
Stopping Netbackup- /usr/openv/netbackup/bin/K77netbackup --> graceful shutdown
- /usr/openv/netbackup/bin/bpps -a --> check for any remaining processes
- /usr/openv/netbackup/bin/goodies/bp.kill_all ---> kills all remaining netbackup processes, not necessarily graceful
- /usr/openv/netbackup/bin/bpps -a --> check for any remaining processes
- kill -9 <pid> for any remaining. NOTE: unkillable processes may require a reboot
- For Unix master, when backups, restores and duplications are not running, please do the following on the master server:1. stop NetBackup (netbackup stop) in the default folder: /usr/openv/netbackup/bin/goodies2. bpps -a , kill the remaining processes3. cd to /usr/openv/netbackup/db/jobs4. rm the bpjobd.act.db file5. cd up to the restart folder (/usr/openv/netbackup/db/jobs/restart)6. pwd to verify, rm all files7. cd..\trylogs8. pwd to verify, rm all files9. cd..\ffilelogs10. pwd to verify, rm all files11. restart NetBackup (netbackup start) in the default folder: /usr/openv/netbackup/bin/goodiesNote: This will not delete the Activity Monitor History. Completed jobs are stored in bpjobd.db file, so do not remove it.
- /usr/openv/netbackup/bin/S77netbackup --> after bp.kill_all, to restart
Common Tasks
Starting the Administration GUI- java from the windows client
- x-windows from the server - /usr/openv/netbackup/bin/xnb &
- Activity Monitor or
- /usr/openv/netbackup/bin/admincmd/bpdbjobs -report
- Identify the drive name to be cleaned
- tpclean -L
- Manually clean the drive:
- tpclean -C <drive name>
- GUI
- Backup and Restore --> Find the file system --> Preview Media Button
- CLI
- Find the correct backup images
- bpimagelist -U -client <CLIENT> -d <STARTDATE> -e <ENDDATE>
- Find the media used for those images
- bpimagelist -U -client <CLIENT> -d <STARTDATE> -e <ENDDATE> -media
- Find the correct backup images
Find the tape(s) used (above procedure using bpimagelist)
cd /usr/openv/netbackup/db/jobs/done
Run the following script and redirect it's output to a text file:
for file in `grep MOUNTING *|grep <MEDIA_ID>|awk '{print $1}'|sed 's/:MOUNTING//'`
do
echo $file
grep PATH_WRITTEN $file|awk '{print $3}'
echo " "
echo "==========================================End of Image======================================"
echo " "
done
This process works for NBU V3.4:
- cd /usr/openv/netbackup/db/images/<CLIENT>
- ls -ltr --> this will identify the directory with the proper date
- verify directory with "bpdbm -ctime <Unixtime>
- cd <Unixtime>
- ls -ltr --> lists all of the backups for this client on this date
- cat <POLICY>_<Unixtime>_<BU Type>.f | awk '{print $10}' --> this prints out the files in the backup
- bpflist --help --> undocumented netbackup command to list files from a binary .f file
Inventory the Robot
- Inventory Robot --> /opt/openv/volmgr/bin/vmcheckxxx -rt robot_type -rn robot_number -list (where robot_type is tld, acs, . . .)
- Inventory Robot and Update Configuration --> /opt/openv/volmgr/bin/vmupdate -rt robot_type -rn robot_number -list (where robot_type is tld, acs, . . .)
- vmpool -listall
- Count scratch tapes: /usr/openv/volmgr/bin/vmquery -pn Scratch | grep -c "robot slot"
- Moving tapes to the scratch pool
- If Needed - Expire the tape
- bpexpdate -ev <TAPE ID> -d 0 -force -host <Media Manager>
- Move the tape
- vmchange -p 2 -m <TAPE ID>
- If Needed - Expire the tape
- /usr/openv/volmgr/bin/vmoprcmd
- /usr/openv/volmgr/vmoprcmd -down <drive index>
- /usr/openv/volmgr/vmoprcmd -up <drive index>
- From the GUI
- user backup & restore --> configuration --> client
- user backup & restore --> configuration --> client to restore
- directory to search
- directory depth
- date range
- file --> browse backups for restore
- Using the GUI
- Media Management --> Actions --> New --> Single Volume . . -->
- Media Type (ie DLT)
- Robot Type (ie TLD)
- Media ID (from Inventory)
- Slot Number (from Inventory)
- Robot Number (ie 0)
- Volume Group
- Volume Pool (ie Scratch)
- Using the CLI
- vmadd -m <media id> -mt <tape type> -verbose -rt <robot
type> -b <barcode> -rn <robot number> -rc1 <slot> -p
<pool number> -mm <max mounts>
- vmpool -listall --> lists all pools, both name and number
- For example: vmadd -m 000151 -mt dlt -verbose -rt tld -b 000151 -rn 0 -rc1 8 -p 2 -mm 0
- vmadd -m <media id> -mt <tape type> -verbose -rt <robot
type> -b <barcode> -rn <robot number> -rc1 <slot> -p
<pool number> -mm <max mounts>
- Expire the media
- bpexpdate -ev MEDIA_ID -d 0 -force -host HOST
- Deassign the media
- vmquery -deassignbyid MEDIA_ID 4 0
- Move to the scratch pool
- vmchange -m MEDIA_ID -p POOL#
- Relabel the media
- bplabel -ev CIM572 -d dlt -p Scratch
- Changing the barcode
- vmchange -barcode CYM100D -m CYM100
- Changing the Volume Pool
- vmchange -m MEDIA_ID -p POOL#
- bpexpdate -ev <medai id> -d 0 -force -host <media server>
- List the frozen media
- /usr/openv/netbackup/bin/goodies/available_media | grep -i FROZEN
- Unfreeze the media
- bpmedia -unfreeze -ev <media id> -h <media server>
- bplabel -ev <media id> -d <tape density> -p <pool
name>
- bplabel -ev 000687 -d dlt -p TriVrgt_OFFSITE
- Verify that there are no images on the tape
- bpimmedia -mediaid 000687 -L
- Expire the tape
- bpexpdate -ev 000687 -d 0 -host scorpius -force
- Get the status and pool number of the tape
- vmquery -m 000687
- Deassign the tape
- vmquery -deassignbyid <media id> <pool number> <status code from vmquery -m>
- vmquery -deassignbyid 000687 4 0x0
- Delete the tape
- vmdelete -m 000687
- /update_clients -ForceInstall -ClientList
/tmp/clients.lst
- requires that TMPDIR and TEMPDIR be set correctly
- Create /usr/openv/netbackup/exclude_list
- Put the file specifications of the files/directories to be excluded
- /mnt/directory/*
- vmquery -m <media id> --> Displays attributes about a particular tape
- bpmedialist -U -mcontents -ev 000687 --> Displays media contents
- bpmedialist -U -mlist --> List of all media
- bpmedialist -U -mlist -ev CYM966 --> Listing of a particular media id
- bpimmedia -mediaid 000687 -L --> Listing of images on a tape
Robtest Commands
- Starting robtest
- robtest
- 1 --> to select TLD 0
- Getting help
- ?
- Looking at contents of the tape drives
- s d
- Looking at the contents of the library
- s s
- Moving a tape from a drive to a library slot
- s d --> to identify drive number that has tape (Contains Cartridge = yes, Barcode=XXXXXX)
- s s --> to identify an empty slot in the tape library (Netbackup will need to be re-inventoried)
- m d# s# --> from from drive # to slot #
- s d --> verify the tape drive is empty
- s s --> verify the library slot has the tape
Configuration Files
/usr/openv/netbackup/bp.conf- configuration file, sets backup server and backup clients
- force statement must be correct
- client to browse from
- client to restore to
Logfiles
To utilize logfiles, create the corresponding directory in /usr/openv/netbackup/logsServer Logfile directories:
- admin - adminstrative commands
- bpbrm - backup and restore manager
- bpcd - client daemon
- bpdbjobs - database manager program process
- bpdm - disk manager process
- bpjava-msvc - Java application server authentication service
- bpjava-usvc - process that services Java requests
- bprd - request daemon process
- bpsched - scheduler process that runs on master servers
- bptm - tape/optical media management process
- user-ops - required directory for use by Java programs
- xbpadm - X based administration utility
- xbpmon - X based job monitor process
- bp - client user interface process
- bparchive - archive program
- bpbackup - backup program
- bpbkar - program that generates golden images
- bpcd - client daemon
- bpjava-msvc - Java application server authentication service
- bpjava-usvc - process that services Java requests
- bplist - program that lists backed up and archived files
- bpmount - program that determines local mountpoints and wildcard expansion for multiple streams
- bphdb - Oracle database backup program start process
- db_log - database specific extension log
- tar - tar process log during restores
- user_ops
.Logging will only occur if these directories are created. These directories will generate a lot of data and should be deleted when no longer necessary.
To increase the amount of logging information set VERBOSE=2 in /usr/open/netbackup/bp.conf (default is VERBOSE=1)
Processes
ltidacsd
vmd
Useful Commands
bpcllist - list classesbpclinfo <class> -L --> displays info about a class
vmpool - volume pools
vmpool -listall
vmpool -listscratch
bplabel -ev <media id> -d hcart
bpbackup db --> backs up the catalog
bpclclients <policy> --> lists the clients for a particular policy (class)
Troubleshooting
bperror -statuscode <-- displays information about the netbackup error.No Backups are running:
- Check system log file for error messages
- Stop and restart all the netbackup processes
- Look for a downed drive
- /usr/openv/volmgr/bin/vmoprcmd
- /usr/openv/volmgr/bin/vmoprcmd -up 0 --> this will bring up drive 0 if it's control shows as down
- Look for pending requests
- /usr/openv/volmgr/bin/vmoprcmd or gui --> device management
- If there is a pending request either re-assign it to a drive, or deny the request
- /usr/openv/volmgr/bin/vmoprcmd or gui --> device management
- Check for a hardware problem by looking for messages on the tape library
- Make sure there is not a tape stuck in the drive
- Use robtest (described above) to look at the drives
- If there is a tape stuck in the drive, try to remove it using robtest
- If robtest fails, then you must manually remove it.
- Use robtest (described above) to look at the drives
- bpclncmd -ip <ip address> --> from both client and server
- bpclntcmd -hn <hostname> --> from both client and server
- bpclntcmd -pn --> from client only
Device Actions
Device Management --> info about tape drives- dlt
- hcart (ultrium)
Media Actions
Media id must agree with # of the tapeCreate a media id
- actions -->new-->single volume-->dlt cart (not dlt2)
- put it into the "netbackup" volume pool
Netbackup Client
To check things out do this:It could be a couple things. Mostly DNS, bp.conf, or something stupid. On
the client run this command
/usr/openv/netbackup/bin/bpclntcmd -pn
/usr/openv/netbackup/bin/bpclntcmd -server "server name"
/usr/openv/netbackup/bin/bpclntcmd ip "ip_address"
One of these usually fails and your able to fix it right off
1074 ./bpclntcmd -hn corpbu1
1075 ./bpclntcmd -ip 10.194.1.129
1076 ping 10.194.1.129
1077 ./bpclntcmd -hn corpldv1
1078 ./bpclntcmd -hn corpbu1.corporate.vox.net
1079 ping corpldv1
1080 ./bpclntcmd -ip 10.194.1.120
Must be able to resolve correctly from the master server and the client or it will not work!!!
Restore
/usr/openv/netbackup/bin/bprestore -B -l [-S netbackup01-man] [-C satellite01-man -D satellite01-man] -R /tmp/rename -s 03/30/12 -e 04/01/12 [-L /tmp/r.log] -f /tmp/filelistWhen using bprestore to recover files and directories, occasionally there will be a need to exclude some of the files and directories. Bprestoreprovides this facility with the aid of the exclamation mark ( ! ). The exclamation mark goes before the file or directory name to be excluded. It can be added from the command line, or placed within a separate file list.
Note: This procedure is not valid when doing Network Data Management Protocol (NDMP) restores.
Command Example 1:This example would restore the "dir" path. However, it will omit the "dir2" directory.
UNIX:/usr/openv/netbackup/bin/bprestore -C <client_name> -L <log_filename> -t <policy_type> /dir !/dir/dir1/dir2
Windows (from the NetBackup\bin directory):
bprestore -C< client_name> -L <log_filename> -t <policy_type> C:\dir !C:\dir\dir1\dir2
Command Example 2:A file list file is more useful when there is a long list of files and directories. The command line for bprestore, using a file list would look like:
UNIX:/usr/openv/netbackup/bin/bprestore -C <client_name> -L <log_filename> -t <policy_type> -f <filelist_filename>
Windows (from theNetBackup\bin directory):
bprestore -C <client_name> -L <log_filename> -t <policy_type> -f< filelist_filename>
File ListsBelow is a very simple example of how a file list file would look:
UNIX:
/dir
!/dir/dir1/dir2
Windows:
C:\dir
!C:\dir\dir1\dir2
If there are any spaces between the file or directory names, the character count must appear before the pathname. The file list would then look similar to the following:
UNIX:
4 /dir
5 /dir2
14 /dir3/filename
15 !/dir/dir1/dir2
Windows:
11 C:\programs
8 C:\winnt
22 C:\documents\old memos
17 !C:\programs\test
restore to an alternate path on the client
1. Create a rename file
Use the following form for the entries in the rename file:
change backup_filepath to restore_filepath
The file paths must start with / (slash).
For example, the following entry in the rename file named /home/admin/rename will restore /usr/Dir1 to /usr/Dir2.
change /usr/Dir1 to /usr/Dir2
2. The syntax for the bprestore command.
/usr/openv/netbackup/bin/bprestore -l -R rename_file filenames
For example, the following command will restore directories and files under /usr/Dir1 to /usr/Dir2.
/usr/openv/netbackup/bin/bprestore -l -R /home/admin/rename /usr/Dir1
The -l specifies that all UNIX hard and soft links be changed.
http://linuxdynasty.org/69/netbackup-troubleshooting-how-to/
Netbackup Cheat Sheet (based on pre-NBU 6.0 information)
http://www.datadisk.co.uk/html_docs/veritas/veritas_netbackup_cs.htm
Master Server Daemons/Processes
Request daemon | bprd |
Scheduler | bpsched (started with bprd) |
Netbackup database manager | bpdbm (started with bpsched) |
Job Monitor | bpjobd (started with bpdbm) |
Communications daemon | bpcd |
Backup and restore manager | bpbrm (started with bpcd) |
Tape Manager | bptm (started with bpbrm) |
Disk Manager | bpdm (started with bpbrm) |
Media Manager | ltid |
Bar code reader | avrd (started with ltid) |
Remote device management/ controls volume database | vmd (started with ltid) |
Roboticdaemon (one on each media server) talks to tldcd | tldd (started with ltid) |
Robotic control daemon talks to the robot directl via scsi | tldcd (started with ltid) |
Master Server
| |
Information about backed-up files | image - /opt/openv/netbackup/db |
Storage Unit, Global Configuration, Catalog backup configuration. | config - /opt/openv/netbackup/db |
Backup Policy information | class - /opt/openv/netbackup/db |
Job status information | jobs - /opt/openv/netbackup/db |
Netbackup logs with error and status information | error - /opt/openv/netbackup/db |
Information on volumes, volume pools, scratch pool and volume groups | volume - /opt/openv/volmgr/database |
Media Server
| |
Tracks assigned volumes (media that has data them) | media - /opt/openv/netbackup/db |
Information about devices managed by the media server | device - /opt/openv/volmgr/database |
Netbackup and Patch versions | /opt/openv/netbackup/bin/version |
Media Version | /opt/openv/volmgr/version |
Patch Level history | /opt/openv/netbackup/patch/patch.history |
Buffer size | /opt/openv/netbackup/db/config/SIZE_DATA_BUFFERS |
Number of buffers | /opt/openv/netbackup/db/config/NUMBER_DATA_BUFFERS |
Network Buffer Size | /opt/openv/netbackup/NET_BUFFER_SZ (default = 32) |
Java GUI authorisation | /opt/openv/java/auth.conf |
Catalog type (binary or ASCII) | /opt/openv/netbackup/db/config/cat_format.cfg |
Netbackup and media manager parameter files | /opt/openv/netbackup/bp.conf /opt/openv/volmgr/vm.conf |
Corrupt Database image files (5.0 and above) | /opt/openv/netbackup/db.corrupt |
Check license details | /opt/openv/netbackup/bin/admincmd/get_license_key |
Start Netbackup | netbackup start /opt/openv/netbackup/bin/initbprd (master) /opt/openv/volmgr/bin/vmd (media) |
Stop Netbackup (does not disconnect GUI sessions) | netbackup stop /opt/openv/netbackup/bin/admincmd/bprdreq -terminate (master) /opt/openv/netbackup/bin/bpdbm -terminate (master) |
Stop Netbackup and kill all GUI sessions | /opt/openv/netbackup/bin/goodies/bp.kill_all |
Start the GUI | /opt/openv/netbackup/bin/jnbSA |
Scan for tape devices | sgscan (solaris) ioscan (HPUX) |
Display all Netbackup processes | bpps -a |
lists servers errors |
bperror -U -problems -hoursago <number of hours>
bperror -U -backstat -by_statcode -hoursago <number of hours> |
display information on a error code | bperror -statuscode <statuscode> [-recommendation] |
Reread bp.conf file without stopping Netbackup | bprdreq -rereadconfig |
Check database consistency | bpdbm -consistency 1 bpdbm -consistency 2 Check for the below lines: Bad image header Does not exist |
Netbackup Recovery
| |
Device catalog is intact | bprecover -l -m <media ID> -d dlt (listing) bprecover -r -m <media ID> -d dlt (recovering) |
Device catalog is gone or corrupted | bprecover -l -tpath <tape_path> (listing) bprecover -r -tpath <tape_path> (recovering) |
Disk backups | bprecover -l -dpath <disk_path> (listing) bprecover -r -dpath <disk_path> (recovering) |
Tape Drive and Inventory Commands
| |
List drive status, detail drive info and pending requests | vmoprcmd |
List the tape drive status | vmoprcmd -d ds |
List the pending requests | vmoprcmd -d pr |
Control a tape device | vmoprcmd [-reset][-up][-down] <drive number> |
List all changes in the robot(but do not update) | vmupdate -recommend -rt tld -rn 0 vmcheckxxx -rt tld -rn 0 -recommend |
Empty the robot and re-inventory (using barcodes) | vmupdate -rt tld -rn <robot number> -rh <silo slave> -vh <host> -nostderr -use_barcode_rules -use_seed -empty_ie |
Tape Media Commands
| |
List all pools | vmpool -listall -bx |
List tapes in pool | vmquery -pn <pool name> -bx |
List all tapes in the robot | vmquery -rn 0 -bx |grep 'TLD' | sort +4 |
List cleaning tapes | vmquery -mt dlt_clean -bx |
List tape volume details | vmquery -m <media ID> |
Delete a volume from the catalog | vmdelete -m <media ID> |
Change a tapes expiry date | vmchange -exp 12/31/06 23:59:58 -m <media ID> |
Change a tape's media pool | vmchange -p <pool number> -m <media ID> |
List the storage units | bpstulist -U |
Freeze or unfreeze media | bpmedia [-freeze][-unfreeze] -ev <media ID> |
List media details | bpmedialist -ev <media ID> |
List media contents | bpmedialist -U mcontents -m <media ID> |
List backup Image Information | bpimagelist -backupid <image ID> |
Expire client images | bpimage -cleanup -allclients |
Expire a tape | bpexpdate -d 0 -ev <media ID> -force |
List all netbackups jobs | bpdbjobs -report [-hoursago] |
Move media from one media server to another | bpmedia -movedb -newserver <media server> -oldserver <media server> |
List tape drives | tpconfig -d |
List cleaning times on drives | tpclean -L |
clean a drive | tpclean -C <drive number> |
change a drives cleaning frequency | tpclean -F <drive> <frequency> |
set a drives cleaning time to zero | tpclean -M <drive> |
Move tapes within robot using robtest | robtest commands that can be used are as follows: s s (show slots) s d (show drives) s i (show load port) m s250 d5 (move tape from slot 250 into drive 5) uload d5 (unload tape from drive 5) m d5 s250 (move tape from drive 5 to slot 250) m s250 i1 (mov tape from slot 250 to load port 1) |
List load port tapes | echo "s i q" | tldtest -r /dev/sg/c0t4l0 |
List all slot contents | echo "s s q" | tldtest -r /dev/sg/c0t4l0 |
List tape drive contents | echo "s d q" | tldtest -r /dev/sg/c0t4l0 |
Move a tape in s100 to drive 1 | echo "m s100 d1" | tldtest -r /dev/sg/c0t4l0 |
Move a tape to load port 1 | echo "m s100 i1" | tldtest -r /dev/sg/c0t4l0 |
list archive info | bpcatlist -client all -before Jul 01 2006 bpcatlist -client all -before Aug 01 2006 |
archive and remove images | bpcatlist -before Jul 01 2006 | bpcatarc | bpcatrm |
restore archive files | bpcatlist -before Jul 01 2006 | bpcatres |
test client connectivity | bpclntcmd [-ip <ip addres>] bpclntcmd [-hn <hostname>] bpclntcmd [-pn] bpclntcmd [-sv] |
List clients | bpplclients |
(<start_date> and <end_date> syntax: MM/DD/YY
<start_time> and <end_time> syntax: hh:mm:ss
<media_id> is the six-character media identification number)
List policies List detailed policies | bppllist -U bppllist -U -allpolicies |
Backup Status Report | bperror -U -backstat -s info [-d <start_date> <start_time> -e <end_date> <end_time>] |
Client Backups Report | bpimagelist -U [-A|-client name] [-d <start_date> <start_time> -e <end_date> <end_time>] |
Problems Report | bperror -U -problems [-d <start_date> <start_time> -e <end_date> <end_time>] |
All Log Entries Report | bperror -U -all [-d <start_date> <start_time> -e <end_date> <end_time>] |
Media List Report | bpmedialist -U -mlist [-m <media_id> |
Media Contents Report | bpmedialist -U -mcontents [-m <media_id>] |
Images on Media Report | bpimmedia -U [-client <client_name>] [-mediaid <media_id>] |
Media Log Entries Report | bperror -U -media [-d <start_date> <start_time> -e <end_date> <end_time>] |
Media Summary Report | bpmedialist -summary |
Media Written Report | bpimagelist -A -media [-d <start_date> <start_time> -e <end_date> <end_time>] |
Volume detail | vmquery -m <media_id> |
* bptestbpcd to test client connectivity as from NBU 6.0 and use bpclntcmd to test hostname lookup.
* For NBU 7.0+, All device config for master and media server(s) as well as media and volume catalogs now reside in the EMM database on the master server
Subscribe to:
Posts (Atom)