#!/usr/bin/perl

# directory initialization
$DIR="/local/Projects";

# #Core
# system("rm -rf $DIR/Perl/predictioncenter/src/Core");
# system("ln -s $DIR/Perl/Core $DIR/Perl/predictioncenter/src/Core");
# 
# #/home/viktor/workspace/predictioncenterorg/Perl/predictioncenter/src/cgi-bin/Classes
# #/home/viktor/workspace/predictioncenterorg/Perl/predictioncenter/src/Classes
# system("rm -rf $DIR/Perl/predictioncenter/src/cgi-bin/Classes");
# system("ln -s $DIR/Perl/predictioncenter/src/Classes $DIR/Perl/predictioncenter/src/cgi-bin/Classes");
# 
# #Core -> ../Core
# system("rm -rf $DIR/Perl/predictioncenter/src/cgi-bin/Core");
# system("ln -s $DIR/Perl/predictioncenter/src/Core $DIR/Perl/predictioncenter/src/cgi-bin/Core");
# 
# #Log
# system("rm -rf $DIR/Perl/predictioncenter/src/cgi-bin/logs");
# system("ln -s $DIR/Perl/predictioncenter/src/logs $DIR/Perl/predictioncenter/src/cgi-bin/logs");
# 
# #tmw -> /local/Projects/Perl/tmw/src/cgi-bin
# system("rm -rf $DIR/Perl/predictioncenter/src/cgi-bin/twm");
# system("ln -s $DIR/Perl/tmw/src/cgi-bin $DIR/Perl/predictioncenter/src/cgi-bin/twm");
# 
# #decoysets -> /local/Projects/Perl/decoysets/src/cgi-bin
# system("rm -rf $DIR/Perl/predictioncenter/src/cgi-bin/decoysets");
# system("ln -s $DIR/Perl/decoysets/src/cgi-bin $DIR/Perl/predictioncenter/src/cgi-bin/decoysets");
# 
# #caspm1 -> /local/Projects/Perl/caspm1/src/cgi-bin
# system("rm -rf $DIR/Perl/predictioncenter/src/cgi-bin/caspm1");
# system("ln -s $DIR/Perl/caspm1/src/cgi-bin $DIR/Perl/predictioncenter/src/cgi-bin/caspm1");
# 
# 
# #casp8 -> /local/Projects/Perl/casp8/src/cgi-bin
# system("rm -rf $DIR/Perl/predictioncenter/src/cgi-bin/casp8");
# system("ln -s $DIR/Perl/casp8/src/cgi-bin $DIR/Perl/predictioncenter/src/cgi-bin/casp8");
# 
# 
# 
# #CASPM LINKS PART
# #Core -> /local/Projects/Perl/Core
# system("rm -rf $DIR/Perl/caspm1/src/Core");
# system("ln -s $DIR/Perl/Core $DIR/Perl/caspm1/src/Core");
# 
# #predictions -> /data/CASPM/predictions
# #PLEASE PAY ATTENTION IF /data/CASPM/predictions is exist
# system("rm -rf $DIR/Perl/caspm1/src/cgi-bin/predictions");
# system("ln -s $DIR/data/CASPM/predictions $DIR/Perl/caspm1/src/cgi-bin/predictions");
# 
# #Core -> ../Core
# #/local/Projects/Perl/caspm1/src/Classes
# system("rm -rf $DIR/Perl/caspm1/src/Classes/Core");
# system("ln -s $DIR/Perl/caspm1/src/Core $DIR/Perl/caspm1/src/Classes/Core");
# 
# #Classes -> ../Classes
# #/local/Projects/Perl/caspm1/src/cgi-bin
# system("rm -rf $DIR/Perl/caspm1/src/cgi-bin/Classes");
# system("ln -s $DIR/Perl/caspm1/src/Classes $DIR/Perl/caspm1/src/cgi-bin/Classes");
# 
# #Core -> ../Core
# #/local/Projects/Perl/caspm1/src/cgi-bin
# system("rm -rf $DIR/Perl/caspm1/src/cgi-bin/Core");
# system("ln -s $DIR/Perl/caspm1/src/Core $DIR/Perl/caspm1/src/cgi-bin/Core");
# 
# 
# #logs -> ../logs
# #/local/Projects/Perl/caspm1/src/cgi-bin
# system("rm -rf $DIR/Perl/caspm1/src/cgi-bin/logs");
# system("ln -s $DIR/Perl/caspm1/src/logs $DIR/Perl/caspm1/src/cgi-bin/logs");
# 


# #predictions -> ../predictions
# #/local/Projects/Perl/caspm1/src/cgi-bin
# system("rm -rf $DIR/Perl/caspm1/src/cgi-bin/predictions");
# system("ln -s $DIR/Perl/caspm1/src/predictions $DIR/Perl/caspm1/src/cgi-bin/predictions");
# 
# #PLEASE PAY ATTENTION IF /data/CASPM/predictions/accepted is exist
# #predictions_accepted -> /data/CASPM/predictions/accepted
# system("rm -rf $DIR/Perl/caspm1/src/cgi-bin/predictions_accepted");
# system("ln -s $DIR/data/CASPM/predictions/accepted $DIR/Perl/caspm1/src/cgi-bin/predictions_accepted");
# 
# 
# 
# #PLEASE PAY ATTENTION IF /data/CASPM/RESULTS is exist
# #RESULTS -> /data/CASPM/RESULTS
# system("rm -rf $DIR/Perl/caspm1/src/cgi-bin/RESULTS");
# system("ln -s $DIR/data/CASPM/RESULTS $DIR/Perl/caspm1/src/cgi-bin/RESULTS");
# 
# 
# 
# #TARGETS -> /local/Projects/Perl/caspm1/src/targets/templates
# #/local/Projects/Perl/caspm1/src/targets/templates
# system("rm -rf $DIR/Perl/caspm1/src/cgi-bin/TARGETS");
# system("ln -s $DIR/Perl/caspm1/src/targets/templates $DIR/Perl/caspm1/src/cgi-bin/TARGETS");
# 
# 



#CASP8 LINKS PART
#Core -> /local/Projects/Perl/Core
system("rm -rf $DIR/Perl/casp8/src/Core");
system("ln -s $DIR/Perl/Core $DIR/Perl/casp8/src/Core");

#predictions -> /data/CASP8/predictions
#PLEASE PAY ATTENTION IF /data/CASP8/predictions is exist
system("rm -rf $DIR/Perl/casp8/src/cgi-bin/predictions");
system("ln -s $DIR/data/CASP8/predictions $DIR/Perl/casp8/src/cgi-bin/predictions");

#Core -> ../Core
#/local/Projects/Perl/casp8/src/Classes
system("rm -rf $DIR/Perl/casp8/src/Classes/Core");
system("ln -s $DIR/Perl/casp8/src/Core $DIR/Perl/casp8/src/Classes/Core");

#Classes -> ../Classes
#/local/Projects/Perl/casp8/src/cgi-bin
system("rm -rf $DIR/Perl/casp8/src/cgi-bin/Classes");
system("ln -s $DIR/Perl/casp8/src/Classes $DIR/Perl/casp8/src/cgi-bin/Classes");

#Core -> ../Core
#/local/Projects/Perl/casp8/src/cgi-bin
system("rm -rf $DIR/Perl/casp8/src/cgi-bin/Core");
system("ln -s $DIR/Perl/casp8/src/Core $DIR/Perl/casp8/src/cgi-bin/Core");

#logs -> ../logs
#/local/Projects/Perl/casp8/src/cgi-bin
system("rm -rf $DIR/Perl/casp8/src/cgi-bin/logs");
system("ln -s $DIR/Perl/casp8/src/logs $DIR/Perl/casp8/src/cgi-bin/logs");

#predictions -> ../predictions
#/local/Projects/Perl/casp8/src/cgi-bin
system("rm -rf $DIR/Perl/casp8/src/cgi-bin/predictions");
system("ln -s $DIR/Perl/casp8/src/predictions $DIR/Perl/casp8/src/cgi-bin/predictions");

#PLEASE PAY ATTENTION IF /data/CASP8/predictions/accepted is exist
#predictions_accepted -> /data/CASP8/predictions/accepted
system("rm -rf $DIR/Perl/casp8/src/cgi-bin/predictions_accepted");
system("ln -s $DIR/data/CASP8/predictions/accepted $DIR/Perl/casp8/src/cgi-bin/predictions_accepted");

#PLEASE PAY ATTENTION IF /data/CASP8/RESULTS is exist
#RESULTS -> /data/CASP8/RESULTS
system("rm -rf $DIR/Perl/casp8/src/cgi-bin/RESULTS");
system("ln -s $DIR/data/CASP8/RESULTS $DIR/Perl/casp8/src/cgi-bin/RESULTS");

#TARGETS -> /local/Projects/Perl/casp8/src/targets/templates
#/local/Projects/Perl/casp8/src/targets/templates
system("rm -rf $DIR/Perl/casp8/src/cgi-bin/TARGETS");
system("ln -s $DIR/Perl/casp8/src/targets/templates $DIR/Perl/casp8/src/cgi-bin/TARGETS");







#following packages should be installed
#apt-get install libhtml-template-expr-perl
#apt-get install libclass-dbi-sqlite-perl
#apt-get install libmath-round-perl
#apt-get install libdbd-pg-perl

#Access to DB
#predictioncenter.org
#1418
#predictioncenter
#predictioncenter

#web
#http://www.predictioncenter.org/ 
#http://www.predictioncenter.org/admin/caspm1/groups.cgi

# DB backup
# root@predictioncenter:/local/Projects/Perl/caspm1/src# su postgres
# postgres@predictioncenter:/local/Projects/Perl/caspm1/src$ /usr/bin/pg_dump -i -p 1418 -F p -s -s -v -f "/home/oleh/backup/1.sql" -n caspm1 predictioncenter


