--- loncom/debugging_tools/db_copy.pl 2006/10/13 21:00:06 1.5 +++ loncom/debugging_tools/db_copy.pl 2012/02/22 17:06:42 1.8 @@ -17,6 +17,22 @@ if (!-x $dump_db || !-x $create_db) { exit(-1); } + +my $return_code = system("/bin/bash -c '$create_db >& /dev/null'"); +# create_db exits on 1 if no filename to create was specified and is thus +# a successful start and stop of the program +if ($return_code == -1 + || (($return_code >> 8) != 1)) { + $create_db = '/home/httpd/perl/debug/create_db_dynamic_64_so.3'; + printf("booM %d %d!\n",$return_code,($return_code >> 8 )); + $return_code = system("/bin/bash -c '$create_db >& /dev/null'"); + if ($return_code == -1 + || (($return_code >> 8) != 1)) { + printf("booM2 %d %d!\n",$return_code,($return_code >> 8 )); + die("Unable to run need helper program create_db_dynamic_64"); + } +} + my %perlvar=%{&LONCAPA::Configuration::read_conf('loncapa.conf')}; my $do_locks = 1; @@ -55,7 +71,7 @@ sub process_db { my $file = $_; my $dbref =&lock_db($file); #print("attempting $file\n"); - system("$dump_db -f $file|$create_db -f $file.new"); + system("/bin/bash -c '$dump_db -f $file|$create_db -f $file.new'"); # print("finishing $dbref\n"); rename($file,"$file.old"); rename("$file.new","$file"); @@ -79,7 +95,7 @@ sub process_db { } sub main { - my $dir = $perlvar{'lonUsersDir'}.'/temp/y/'; + my $dir = $perlvar{'lonUsersDir'}; print("Doing $dir\n"); &find({ no_chdir => 1, wanted => \&count_db, },