In linux, databases are regularly backed up after time.
bakfordatabase.shmysqldump -uuser -ppassword database>folder/`date "+%Y-%m-%d~%H-%M-%S"`.sql
Back up a mysql database in a specified time
Mongodump-d database-o folder' back up mongodb Databases
Cd folder
Tar-cf database-''%%y-%m-%d''.tar database'
Rm-r database 'delete the original file
Back up the mangodb database by name
00 07 * * * sh folder/bakfordatabase.sh<pre name="code" class="plain">00 */8 * * * sh folder/bakfordatabase.sh
Regular backup in crontab
In linux, how does one implement regular database backup?
Run crontab-e as the root user.
Format:
* *** Command (dd, tar, or another method)
Minutes, days, months, and weeks
For example
1 2 3 4 * tar jcvpf/back/home.tar.bz2/home
Put/home in the/back directory in the format of bz2 at 02:01 on January 1, April 3.
For example
1 2*4 3 tar jcvpf/back/home.tar.bz2/home
Package/home in the format of bz2 in the/back directory at 02:01 every week, January 1, April.
Linux oracle Scheduled Backup
The scripts executed by crontab are called by the root user. Therefore, you must add oracle user environment variables such as ORACLE_HOME, ORACLE_BASE, and ORACLE_SID. ORACLE_HOME/bin must also be added to the path.
In addition, expdp_oracle.sh other users must have the execution permission.
Example:
Vi expdp_oracle.sh
Export ORACLE_BASE =/u01/app/oracle
Export ORACLE_HOME =/u01/app/oracle/product/10.2/db_1
Export ORACLE_SID = orcl
Export PATH =/u01/app/oracle/product/10.2/db_1/bin; $ PATH
Expdp system/oracle directory = DDPDATA21 dumpfile = rrq. dmp schemas = 'ms ';
Wq: