我最近在 Ubuntu 服务器上设置了 automysqlbackup。
该脚本运行良好并且没有报告任何错误——它按预期创建了 tar.gz 文件。但是,当我从存档中提取实际的 sql 文件时,它是一个零长度文件。
配置中有什么明显的遗漏吗?
这是我修改的配置文件的唯一部分:
# Username to access the MySQL server e.g. dbuser
USERNAME=myusername
# Username to access the MySQL server e.g. password
PASSWORD=mypass
# Host name (or IP address) of MySQL server e.g localhost
DBHOST=mysql.remotehost.com
# List of DBNAMES for Daily/Weekly Backup e.g. "DB1 DB2 DB3"
# Note that it's absolutely normal that the db named "mysql" is not in this
# list, as it's added later by the script. See the MDBNAMES directives below
# in this file (advanced options).
# This is ONLY a convenient default, if you don't like it, don't complain
# and write your own.
# The following is a quick hack that will find the names of the databases by
# reading the mysql folder content. Feel free to replace by something else.
# This one does a list of dbs using a MySQL statement.
DBNAMES='mydbname'
# Backup directory location e.g /backups
# Folders inside this one will be created (daily, weekly, etc.), and the
# subfolders will be database names. Note that backups will be owned by
# root, with Unix rights 0600.
BACKUPDIR='/home/myuser/automysqlbackup'
哦。用户错误。我的主机不接受来自我的 IP 的连接,但由于某种原因没有返回任何错误,所以脚本只是挂起。
奇怪的是 automysqlbackup 在明显超时后没有报告任何问题,但现在已经解决了。