17 $Usage =
"Usage: " . basename($argv[0]) .
"
20 --help help, this message (Note: the user postgres should have write permission on the output file.)
23 $Options = getopt(
"hf:", array(
"help"));
27 foreach($Options as $Option => $OptVal)
32 $SchemaFilePath = $OptVal;
41 echo
"Invalid Option \"$Option\".\n";
47 # dump license_ref table into a temp file
48 if (empty($SchemaFilePath)) $SchemaFilePath =
"licenseref.sql";
49 $dump_command =
"sudo su postgres -c 'pg_dump -f $SchemaFilePath -a -t license_ref --column-inserts fossology'";
50 system($dump_command, $return_var);
52 if(!$return_var) exit (0);