2008-02-14 14:25:49 +00:00
|
|
|
=head1 NAME
|
|
|
|
|
|
|
|
B<tabrestore> - replaces the contents of an xCAT database table with the contents in a csv file.
|
|
|
|
|
|
|
|
=head1 SYNOPSIS
|
|
|
|
|
2008-03-05 16:49:19 +00:00
|
|
|
B<tabrestore> I<table.csv>
|
2008-02-14 14:25:49 +00:00
|
|
|
|
2008-03-05 16:49:19 +00:00
|
|
|
B<tabrestore> [I<-?> | I<-h> | I<--help>]
|
2008-02-14 14:25:49 +00:00
|
|
|
|
|
|
|
=head1 DESCRIPTION
|
|
|
|
|
|
|
|
The tabrestore command reads the contents of the specified file and puts its data
|
|
|
|
in the corresponding table in the xCAT database. Any existing rows in that table
|
|
|
|
are replaced. The file must be in csv format. It could be created by tabdump.
|
|
|
|
Only one table can be specified.
|
|
|
|
|
|
|
|
This command can be used to copy the example table entries in /opt/xcat/share/xcat/templates/e1350
|
|
|
|
into the xCAT database.
|
|
|
|
|
|
|
|
=head1 OPTIONS
|
|
|
|
|
2008-03-05 16:49:19 +00:00
|
|
|
=over 10
|
|
|
|
|
|
|
|
=item B<-?|-h|--help>
|
|
|
|
|
|
|
|
Display usage message.
|
|
|
|
|
|
|
|
=back
|
2008-02-14 14:25:49 +00:00
|
|
|
|
|
|
|
=head1 RETURN VALUE
|
|
|
|
|
2008-03-05 16:49:19 +00:00
|
|
|
=over 3
|
|
|
|
|
|
|
|
=item 0
|
|
|
|
|
|
|
|
The command completed successfully.
|
|
|
|
|
|
|
|
=item 1
|
2008-02-14 14:25:49 +00:00
|
|
|
|
2008-03-05 16:49:19 +00:00
|
|
|
An error has occurred.
|
|
|
|
|
|
|
|
=back
|
2008-02-14 14:25:49 +00:00
|
|
|
|
|
|
|
=head1 EXAMPLES
|
|
|
|
|
2008-03-05 16:49:19 +00:00
|
|
|
=over 2
|
|
|
|
|
|
|
|
=item *
|
|
|
|
|
|
|
|
To put rows into the mp table:
|
2008-02-14 14:25:49 +00:00
|
|
|
|
2008-03-05 16:49:19 +00:00
|
|
|
B<tabrestore> I<mp.csv>
|
2008-02-14 14:25:49 +00:00
|
|
|
|
|
|
|
The file mp.csv could contain something like:
|
|
|
|
|
2008-02-18 15:57:25 +00:00
|
|
|
#node,mpa,id,comments,disable
|
|
|
|
"blade","|\D+(\d+)|amm(($1-1)/14+1)|","|\D+(\d+)|(($1-1)%14+1)|",,
|
|
|
|
|
2008-03-05 16:49:19 +00:00
|
|
|
=item *
|
|
|
|
|
|
|
|
To restore database tables that were dumped with tabdump:
|
2008-02-18 15:57:25 +00:00
|
|
|
|
|
|
|
cd /tmp/xcatdb.backup
|
|
|
|
for i in *.csv;do echo "Restoring $i..."; tabrestore $i; done
|
2008-02-14 14:25:49 +00:00
|
|
|
|
2008-03-05 16:49:19 +00:00
|
|
|
=back
|
|
|
|
|
2008-02-14 14:25:49 +00:00
|
|
|
=head1 FILES
|
|
|
|
|
|
|
|
/opt/xcat/sbin/tabrestore
|
|
|
|
|
2008-03-05 16:49:19 +00:00
|
|
|
=head1 SEE ALSO
|
2008-02-14 14:25:49 +00:00
|
|
|
|
2008-03-05 16:49:19 +00:00
|
|
|
tabdump(1), tabedit(1)
|