Exemplo n.º 1
0
def main():
    print "In main()..."
    env.nyc_sub_path = "/usr/local/virtuoso-opensource/share/virtuoso/vad/3t_backup"
    one_graph_backup_nyc(env.nyc_virtuoso_user, env.nyc_virtuoso_password, env.nyc_sub_path, env.nyc_isql_path, env.nyc_host, env.nyc_user)
    nyc_source_dir = env.nyc_sub_path + "/" + env.timestamp + "/*" 
   
    
    source_before_dir = env.local_backup_dir + "/source-before/"
    if not os.path.exists(source_before_dir):
            os.makedirs(source_before_dir)
    print "Calling backup_to_local()..."
    backup_to_local(env.nyc_user, env.nyc_host, nyc_source_dir, source_before_dir)

    env.aws_sub_path = "/usr/share/virtuoso-opensource-7.1/vad/3t_backup"
    aws_source_dir = one_graph_backup_aws(env.aws_virtuoso_user, env.aws_virtuoso_password, env.aws_sub_path, env.aws_isql_path, env.aws_host, env.aws_user, env.aws_dev_key_file)
    aws_source_dir = env.aws_sub_path + "/" + env.timestamp + "/*" 
    
    target_before_dir = env.local_backup_dir + "/target-before/"
    if not os.path.exists(target_before_dir):
            os.makedirs(target_before_dir)
    print "Calling backup_to_local()..."
    backup_to_local(env.aws_user, env.aws_host, aws_source_dir, target_before_dir)
    
    target_temp_path="/tmp/virtuoso-restore/one_graph/" + env.timestamp
    print "Calling backup_to_aws()..."
    backup_to_aws(env.aws_user, env.aws_host, source_before_dir + "*", env.aws_dev_key_file, target_temp_path)
    
    print "Calling restore_rw()..."
    for k, v in dict_ttSettings["virtuoso"]["graphs"]["rw"].items():
        graph_name = v["graph_name"]
        restore_rw(env.aws_user, env.aws_host, env.aws_dev_key_file, graph_name, target_temp_path)
Exemplo n.º 2
0
def main():
    print "In main()..."
    
    """***************************************************************************************************************"""
    env.nyc_sub_path = "/usr/local/virtuoso-opensource/share/virtuoso/vad/3t_backup"
    one_graph_backup_nyc(env.nyc_virtuoso_user, env.nyc_virtuoso_password, env.nyc_sub_path, \
                         env.nyc_isql_path, env.nyc_host, env.nyc_user)
    source_before_dir = env.local_backup_dir + "/source-before/"
    if not os.path.exists(source_before_dir):
            os.makedirs(source_before_dir)
    nyc_source_dir = env.nyc_sub_path + "/" + env.timestamp + "/*"
    print "Calling backup_to_local()...before"
    backup_to_local(env.nyc_user, env.nyc_host, nyc_source_dir, source_before_dir)
    print "backup_to_local()...before...successful!!!"
    print "Calling remove_nyc_server_backup()..."
    remove_nyc_server_backup(env.nyc_sub_path, env.timestamp, env.nyc_host, env.nyc_user)
    print "remove_nyc_server_backup()...successful!!!"

    env.aws_sub_path = "/usr/share/virtuoso-opensource-7.1/vad/3t_backup"
    aws_source_dir = one_graph_backup_aws(env.aws_virtuoso_user, env.aws_virtuoso_password, env.aws_sub_path, \
                                          env.aws_isql_path, env.aws_host, env.aws_user, env.aws_dev_key_file)
    aws_source_dir = env.aws_sub_path + "/" + env.timestamp + "/*" 
    target_before_dir = env.local_backup_dir + "/target-before/"
    if not os.path.exists(target_before_dir):
            os.makedirs(target_before_dir)
    print "Calling backup_to_local()..."
    backup_to_local(env.aws_user, env.aws_host, aws_source_dir, target_before_dir)
    
    print "Calling remove_aws_server_backup()..."
    remove_aws_server_backup(env.nyc_sub_path, env.timestamp, env.nyc_host, env.nyc_user, env.aws_dev_key_file)
    print "remove_aws_server_backup()...successful!!!"
        
    target_temp_path="/tmp/virtuoso-restore/one_graph/" + env.timestamp
    print "Calling backup_to_aws()..."
    backup_to_aws(env.aws_user, env.aws_host, source_before_dir + "*", env.aws_dev_key_file, target_temp_path)
    
    print "Calling restore_rw()..."
    for k, v in dict_ttSettings["virtuoso"]["graphs"]["rw"].items():
        graph_name = v["graph_name"]
        restore_rw(env.aws_user, env.aws_host, env.aws_dev_key_file, graph_name, target_temp_path)
    
    print "remove_temp_restore()..."
    remove_temp_restore(env.aws_user, env.aws_host, env.aws_dev_key_file, target_temp_path)
    
    """***************************************************************************************************************"""
    one_graph_backup_nyc(env.nyc_virtuoso_user, env.nyc_virtuoso_password, env.nyc_sub_path, \
                         env.nyc_isql_path, env.nyc_host, env.nyc_user)
    source_after_dir = env.local_backup_dir + "/source-after/"
    if not os.path.exists(source_after_dir):
            os.makedirs(source_after_dir)
    nyc_source_dir = env.nyc_sub_path + "/" + env.timestamp + "/*"
    print "Calling backup_to_local()...after"
    backup_to_local(env.nyc_user, env.nyc_host, nyc_source_dir, source_before_dir)
    print "backup_to_local()...after..successful!!!"
    print "Calling remove_nyc_server_backup()..."
    remove_nyc_server_backup(env.nyc_sub_path, env.timestamp, env.nyc_host, env.nyc_user)
    print "remove_nyc_server_backup()...successful!!!"

    env.aws_sub_path = "/usr/share/virtuoso-opensource-7.1/vad/3t_backup"
    aws_source_dir = one_graph_backup_aws(env.aws_virtuoso_user, env.aws_virtuoso_password, env.aws_sub_path, \
                                          env.aws_isql_path, env.aws_host, env.aws_user, env.aws_dev_key_file)
    aws_source_dir = env.aws_sub_path + "/" + env.timestamp + "/*" 
    target_before_dir = env.local_backup_dir + "/target-after/"
    if not os.path.exists(target_before_dir):
            os.makedirs(target_before_dir)
    print "Calling backup_to_local()..."
    backup_to_local(env.aws_user, env.aws_host, aws_source_dir, target_before_dir)
    
    print "Calling remove_aws_server_backup()..."
    remove_aws_server_backup(env.nyc_sub_path, env.timestamp, env.nyc_host, env.nyc_user, env.aws_dev_key_file)
    print "remove_aws_server_backup()...successful!!!"
    """***************************************************************************************************************"""
    
    print "Clone operations successful!!!"
Exemplo n.º 3
0
def virtuoso_operations():
    print "In main()..."
    """***************************************************************************************************************"""
    env.nyc_sub_path = "/usr/local/virtuoso-opensource/share/virtuoso/vad/3t_backup"
    one_graph_backup_nyc(env.nyc_virtuoso_user, env.nyc_virtuoso_password, env.nyc_sub_path, \
                         env.nyc_isql_path, env.nyc_host, env.nyc_user)
    source_before_dir = env.local_backup_dir + "/source-before/"
    if not os.path.exists(source_before_dir):
        os.makedirs(source_before_dir)
    nyc_source_dir = env.nyc_sub_path + "/" + env.timestamp + "/*"
    print "Calling backup_virt_to_local()...before"
    backup_virt_to_local(env.nyc_user, env.nyc_host, nyc_source_dir,
                         source_before_dir)
    print "backup_virt_to_local()...before...successful!!!"
    print "Calling remove_nyc_server_backup()..."
    remove_nyc_server_backup(env.nyc_sub_path, env.timestamp, env.nyc_host,
                             env.nyc_user)
    print "remove_nyc_server_backup()...successful!!!"

    env.aws_sub_path = "/usr/share/virtuoso-opensource-7.1/vad/3t_backup"
    aws_source_dir = one_graph_backup_aws(env.aws_virtuoso_user, env.aws_virtuoso_password, env.aws_sub_path, \
                                          env.aws_isql_path, env.aws_host, env.aws_user, env.aws_dev_key_file)
    aws_source_dir = env.aws_sub_path + "/" + env.timestamp + "/*"
    target_before_dir = env.local_backup_dir + "/target-before/"
    if not os.path.exists(target_before_dir):
        os.makedirs(target_before_dir)
    print "Calling backup_virt_to_local()..."
    backup_virt_to_local(env.aws_user, env.aws_host, aws_source_dir,
                         target_before_dir)

    print "Calling remove_aws_server_backup()..."
    remove_aws_server_backup(env.aws_sub_path, env.timestamp, env.aws_host,
                             env.aws_user, env.aws_dev_key_file)
    print "remove_aws_server_backup()...successful!!!"

    target_temp_path = "/tmp/virtuoso-restore/one_graph/" + env.timestamp
    print "Calling backup_to_aws()..."
    backup_to_aws(env.aws_user, env.aws_host, source_before_dir + "*",
                  env.aws_dev_key_file, target_temp_path)

    print "Calling restore_rw()..."
    for k, v in dict_ttSettings["virtuoso"]["graphs"]["rw"].items():
        graph_name = v["graph_name"]
        restore_rw(env.aws_user, env.aws_host, env.aws_dev_key_file,
                   graph_name, target_temp_path)

    print "remove_temp_restore()..."
    remove_temp_restore(env.aws_user, env.aws_host, env.aws_dev_key_file,
                        target_temp_path)
    """***************************************************************************************************************"""
    one_graph_backup_nyc(env.nyc_virtuoso_user, env.nyc_virtuoso_password, env.nyc_sub_path, \
                         env.nyc_isql_path, env.nyc_host, env.nyc_user)
    source_after_dir = env.local_backup_dir + "/source-after/"
    if not os.path.exists(source_after_dir):
        os.makedirs(source_after_dir)
    nyc_source_dir = env.nyc_sub_path + "/" + env.timestamp + "/*"
    print "Calling backup_virt_to_local()...after"
    backup_virt_to_local(env.nyc_user, env.nyc_host, nyc_source_dir,
                         source_before_dir)
    print "backup_virt_to_local()...after..successful!!!"
    print "Calling remove_nyc_server_backup()..."
    remove_nyc_server_backup(env.nyc_sub_path, env.timestamp, env.nyc_host,
                             env.nyc_user)
    print "remove_nyc_server_backup()...successful!!!"

    env.aws_sub_path = "/usr/share/virtuoso-opensource-7.1/vad/3t_backup"
    aws_source_dir = one_graph_backup_aws(env.aws_virtuoso_user, env.aws_virtuoso_password, env.aws_sub_path, \
                                          env.aws_isql_path, env.aws_host, env.aws_user, env.aws_dev_key_file)
    aws_source_dir = env.aws_sub_path + "/" + env.timestamp + "/*"
    target_before_dir = env.local_backup_dir + "/target-after/"
    if not os.path.exists(target_before_dir):
        os.makedirs(target_before_dir)
    print "Calling backup_virt_to_local()..."
    backup_virt_to_local(env.aws_user, env.aws_host, aws_source_dir,
                         target_before_dir)

    print "Calling remove_aws_server_backup()..."
    remove_aws_server_backup(env.aws_sub_path, env.timestamp, env.aws_host,
                             env.aws_user, env.aws_dev_key_file)
    print "remove_aws_server_backup()...successful!!!"
    """***************************************************************************************************************"""

    print "Clone operations successful!!!"