arangodb資料庫備份之 匯出匯入

2021-10-09 16:48:26 字數 1001 閱讀 1219

執行如下bash指令碼:

#!/bin/sh 

arangodump --server.endpoint tcp://: --server.username --server.password --server.database --output-di rectory //dump-$(

date

"+%y%m%d-%h:%m:%s"

)find // -mtime +7 -name "dump-*" -exec rm -rf \;

> /dev/null​

執行如下python指令碼:

# _*_ coding: utf-8 _*_

import os

path =

raw_input

("請輸入備份檔案路徑: "

)ip =

raw_input

("請輸入arangodb伺服器ip: "

)port =

raw_input

("請輸入arangodb服務埠: "

)username =

raw_input

("請輸入arangodb資料庫使用者名稱: "

)passwd =

raw_input

("請輸入arangodb資料庫使用者密碼: "

)database =

raw_input

("請輸入arangodb資料庫: "

)cmd =

"arangorestore --server.endpoint tcp://%s:%s --server.username %s --server.password %s --server.database %s --input-directory %s --overwrite true"

%(ip, port, username, passwd, database, path)

os.system(cmd)

資料庫互導

1 sqlserver與access互導 方法一 用sql語句 匯出到access insert into openrowset microsoft.jet.oledb.4.0 x a.mdb admin a表 select from 資料庫名.b表 匯入access insert into b表 ...

centos postgresql資料庫匯入匯出

匯入整個資料庫 psql u postgres 使用者名稱 資料庫名 預設時同使用者名稱 data dum.sql 匯出整個資料庫 pg dump h localhost u postgres 使用者名稱 資料庫名 預設時同使用者名稱 data dum.sql 匯出某個表 pg dump h loc...

Mysql之資料庫備份

1.手動拷貝備份 mysql資料庫的檔案儲存在目錄 var lib mysql中,資料庫為每個庫建立乙個目錄,所有的資料庫檔案都在這些目錄中.root linuxhero mysql ls root linuxhero mysql servcie mysqld stop 先停止資料庫 bbs mys...