Skip to content

services.mysqlBackup don't work with default settings #24728

@davidak

Description

@davidak

Issue description

the backup files get created but are empty.

Steps to reproduce

  1. configure mysqlBackup
  services.mysqlBackup = {
    enable = true;
    databases = [ "mysql" "piwik" "satzgenerator" ];
    location = "/var/backup/mysql";
    period = "0 4 * * *";
    singleTransaction = true;
  };
  1. wait one day
  2. see created archives
[root@atomic:~]# ll /var/backup/mysql/
insgesamt 12
-rw-r--r-- 1 mysql mysql 20  7. Apr 04:00 mysql.gz
-rw-r--r-- 1 mysql mysql 20  7. Apr 04:00 piwik.gz
-rw-r--r-- 1 mysql mysql 20  7. Apr 04:00 satzgenerator.gz
  1. display content: zcat /var/backup/mysql/mysql.gz (nothing)

running the cron command manually (as root) works.

/nix/store/d2bkgmfk8q1ak2iz17bw5bk08gq8k44v-mariadb-10.1.21/bin/mysqldump --single-transaction mysql | /nix/store/w1vlvxlavmz39by5xpnhva36q2lbi9hf-gzip-1.8/bin/gzip -c > test.gz

i can't log in as user mysql, so maybe that is the problem?

[root@atomic:~]# su - mysql
This account is currently not available.

/cc @rbvermaa (creator of module)

Technical details

  • System: NixOS 17.03.902.536d3cac2e (Gorilla)
  • Nix version: nix-env (Nix) 1.11.8
  • Nixpkgs version: 17.03.902.536d3cac2e
  • MySQL is actually MariaDB 10.1.21

Metadata

Metadata

Assignees

No one assigned

    Labels

    6.topic: nixosIssues or PRs affecting NixOS modules, or package usability issues specific to NixOS
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions