Directadmin 自动备份到Google Drive
2018/06/13 23:41
教程
1、首先你要在服务器上安装好Gdrive
2、在DA的机器上面执行以下命令
touch /usr/local/directadmin/scripts/custom/all_backups_post.sh chmod 777 /usr/local/directadmin/scripts/custom/all_backups_post.sh
3、编辑/usr/local/directadmin/scripts/custom/all_backups_post.sh, 复制下面的东西上去即可 (中文内容需要根据实际情况修改)
vi /usr/local/directadmin/scripts/custom/all_backups_post.sh #!/bin/sh nowdate=$(date +"%Y-%m-%d") if [ "$success" == "0" ];then exit; fi; floder_hash=$(gdrive mkdir -p "Gdrive文件夹Hash" $nowdate | awk '{print $2}') gdrive sync upload /home/管理员名称/admin_backups/$nowdate "$floder_hash"
4、去Directadmin后台设置备份,自动或手动备份均可,唯一要注意的是备份路径要选local,这个路径要和上面sh中的内容保持一致,保存的格式参考下图:
本文参考:https://www.ruooo.com/vps/1347.html
留言评论