OrientDB中的数据导出主要通过 EXPORT DATABASE
进行导出。
这里一个定期导出的脚步如下:
$ vim export.sh
完整内容如下:
## filename: export.sh
# 1. export the db
/opt/orientdb/bin/console.sh < /opt/orientdb/bin/jia.txt
# filename: jia.txt
# connect remote:localhost/cmdb_demo root root;
# EXPORT DATABASE /root/cmdb2.export;
# disconnect;
# exit;
echo "export database"
# 2. change the name
d=`date +%Y-%m-%d`
echo $d
b='cmdb2-'$d'.export.gz'
echo $b
#mv /root/fd-export-demo.export.gz /root/fd-export-demo.export
mv /root/cmdb2.export.gz /root/$b
echo "change database name"
添加到定时任务中:
$ crontab -e
59 23 * * * /bin/bash /root/export.sh
扩展阅读
OrientDB导出数据库
https://www.w3cschool.cn/orientdb/orientdb_export_database.html
网友评论