2008-02-14 14:25:49 +00:00
|
|
|
=head1 NAME
|
|
|
|
|
2013-09-13 18:13:44 +00:00
|
|
|
B<tabrestore> - replaces with or adds to a xCAT database table the contents in a csv file.
|
2008-02-14 14:25:49 +00:00
|
|
|
|
|
|
|
=head1 SYNOPSIS
|
|
|
|
|
2013-09-13 18:13:44 +00:00
|
|
|
B<tabrestore> [-a] 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
|
|
|
|
2013-09-13 18:13:44 +00:00
|
|
|
B<tabrestore> [I<v> | I<--version>]
|
|
|
|
|
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
|
2013-09-13 18:13:44 +00:00
|
|
|
are replaced unless the (-a) flag is used and then the rows in the file are added to the table.
|
|
|
|
The file must be in csv format. It could be created by tabdump.
|
2008-02-14 14:25:49 +00:00
|
|
|
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.
|
|
|
|
|
2013-09-13 18:13:44 +00:00
|
|
|
=item B<-v|--version>
|
|
|
|
|
|
|
|
Display version.
|
|
|
|
|
|
|
|
=item B<-a|--addrows>
|
|
|
|
|
|
|
|
Add rows from the CSV file to the table instead of replacing the table with the CSV file.
|
|
|
|
|
2008-03-05 16:49:19 +00:00
|
|
|
=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 *
|
|
|
|
|
2013-09-13 18:13:44 +00:00
|
|
|
To replace the rows in the mp table with the rows in the mp.csv file:
|
2008-02-14 14:25:49 +00:00
|
|
|
|
2013-09-13 18:13:44 +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 *
|
|
|
|
|
2013-09-13 18:13:44 +00:00
|
|
|
To add the rows in the mp.csv file to the rows in the mp table:
|
|
|
|
|
|
|
|
B< tabrestore> -a I<mp.csv>
|
|
|
|
|
|
|
|
=item *
|
|
|
|
|
2008-03-28 13:42:31 +00:00
|
|
|
To restore database tables that we dumped with dumpxCATdb:
|
2008-02-18 15:57:25 +00:00
|
|
|
|
2013-09-13 18:13:44 +00:00
|
|
|
restorexCATdb -p <restore directory>
|
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-08-02 16:18:07 +00:00
|
|
|
L<tabdump(8)|tabdump.8>, L<tabedit(8)|tabedit.8>, L<dumpxCATdb(1)|dumpxCATdb.1>
|