企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
1)每天晚上12点执行备份gogs数据库的操作,然后通过rsync把备份推送到备份服务器上 在mysql5.1.73上操作 mysql> grant Select,lock tables on gogs.* to 'back'@'10.2.11.%' identified by 'Aa123456'; mysql> flush privileges; 备份数据库脚本 [git@node1 ~]$ vim backup_gogs_db.sh #!/bin/bash Date=$(date "+%Y-%m-%d") BackDir=/home/git/backup File=gogs_${Date}.sql user="back" host="10.2.11.204" passwd="Aa123456" db="gogs" mysqldump -u $user -p$passwd -h $host -B --database $db > ${BackDir}/${File} if [ $? -eq 0 ];then echo "Your database backup successfully completed" else echo "you database backup fail" fi 配置rsync客户端