mysqlbackup - create everyday MySQL-databases backup




SYNOPSIS

       mysqlbackup [OPTIONS] [database [database [ ... ] ]]


DESCRIPTION

       mysqlbackup creates everyday MySQL databases backup


OPTIONS

       -a     Dump all available databases.

       -u user
              The MySQL user name to use when connecting to the server.

       -h host
              Connect to host.

       -p password
              Password  to use when connecting to server. You should note that
              specifying a password on the command line should  be  considered
              insecure.

       -P filename|ask
              Read  the  clear  password from the file. The file must normally
              not be readable by "others" and must contain exactly  one  line.
              Password  will  be prompted from the command line if the special
              keyword "ask" specified here.

       -o option|no
              Additional mysqldump option. To  specify  multiple  options  you
              should  repeat  this key for each mysqldump-option.  The default
              options are: --opt --skip-lock-tables --quote-names.  To not use
              the default options force "no" option.

       -l days
              Keep  created backups for the specified number of the days.  The
              default is 5 days.

       -d directory
              Target directory to archive backups.  The default is  /var/back-
              ups (will be created if need).

       -z gzip|bzip2|no
              Compress  dumps  with specified program.  The default compressor
              is bzip2(1).  Use special "no" keyword to disable compressing.

       -F mode
              Create files with given mode access  permissions.   The  default
              mode is 0600.

       -D mode
              Create  directories  with  given  mode  access permissions.  The
              default mode is 0700.

       -m path|yes|no
              Save my.cnf config or specify it alternate  path.   Default  is:
              yes, %%DATADIR%%my.cnf.

       -C yes|no|keys
              Check  tables  before  doing  backup  or  use specified keys for
              mysqlcheck(1) program  while  perfoming  check.   Default:  yes,
              keys: --auto-repair --check-only-changed --extended --silent.

       -O yes|no|keys
              Optimize  tables  before  doing backup or use specified keys for
              mysqlcheck(1) program while perfoming optimization.   Note  that
              not  all table engines supports table optimization. Please refer
              to "OPTIMIZE TABLE Syntax"  paragraph  of  MySQL  documentation.
              Default: yes, keys: --optimize --silent.

       -L lockfile
              Alternate  default path to lockfile (/var/tmp/mysqlbackup.lock).

       -t seconds
              Timeout in seconds to  expire  existing  lockfile.   By  default
              lockfile expires after 90000 seconds.

       -v     Be verbose.

       -V     Print version and exit.

       -H     Print this help and exit.


EXAMPLES

       mysqlbackup
              Do nothing, print help.

       mysqlbackup -av
              Verbose  dump  all  the  accessible databases on the local MySQL
              server.

       mysqlbackup -c no mysql
              Backup MySQL system database  without  output  dump  being  com-
              pressed.

       mysqlbackup -a -P ask
              You are prompted for password to backup all the databases.

       Just  add  command with parameters to your crontab(1) to create regular
       MySQL backups.


ENVIRONMENT

       MYSQL_PREFIX environment variable  specifies  your  MySQL  installation
       prefix.  All used MySQL binaries (mysqldump, mysql, mysqlcheck) will be
       searched within this prefix at `bin' directory.


SECURITY

       You should keep your password in secure.

       The method of specifying your MySQL password with  -p  option  must  be
       considered  extremely  insecure  and  should not be used. Your password
       becomes visible to system status  programs  such  as  ps  that  may  be
       invoked by other users to display command lines.

       Store  your  password  in  an option file. For example, on Unix you can
       list your password in the [client] section of the .my.cnf file in  your
       home directory:

               [client]
               password=your_pass

       To  keep the password safe, the file should not be accessible to anyone
       but yourself. To ensure this, set the file access mode to 400 or 600.


AVAILABILITY

       The latest version of this distribution is available on-line from:

           http://www.renatasystems.org/freebsd/mysqlbackup.html


AUTHOR

       Written by Alexey V. Degtyarev


REPORTING BUGS

       Report bugs to <alexey@renatasystems.org>


SEE ALSO

       mysqldump(1), mysqlcheck(1), mysql(1)



FreeBSD                            June 2009                    MYSQLBACKUP(1)

Man(1) output converted with man2html