Get the App
SLTechnology News&Howtos  ›  Database  › 

Linux backup files and database scripts

Shulou Source: shulou.com Published: 2022-06-01 13:02:03 11月17日 Update

Back up the database:

#! / bin/bash

# bei fen mysql:moves

# time:2016/3/27

PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin

Export PATH

# backup database

# mysqldump-uroot-p password database name | gzip > path / moves`date +% Ymuri% mmi% dice% H% M% S`.sql.gz

# backup files

The path to which the tar-zcvf path / mymove`date +% Ymure% mmury% mmury% dink% H% M% S`.tar.gz is backed up

Tags: Backup data database path file password script Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Technology Redmi MariaDB Xiaomi Huawei