automysqlbackup 文件为空

automysqlbackup 文件为空

我最近在 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'

答案1

哎呀。用户错误。我的主机不接受来自我的 IP 的连接,但由于某种原因没有返回任何错误,所以脚本就挂起了。

奇怪的是,automysqlbackup 在明显超时后没有报告任何问题,但现在已经解决了。

相关内容