Please do not put the backup script under the Backup_dir, add to the crontab timer run
#!/bin/sh
Export Oracle_home=/u01/app/oracle/product/10.2.0/db_1
Export ORACLE_SID=ORCL
Export Nls_lang=american_america. Zhs16gbk
Export Path=/usr/lib64/qt-3.3/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/oracle/bin :/u01/app/oracle/product/10.2.0/db_1/bin
Export Backup_dir=/orabackup
Export now=$ (date ' +%y%d%m ')
Exp system/[email protected]_sid file= $BACKUP _dir/system$now.dmp log= $BACKUP _dir/system$now.log full=y
CD $BACKUP _dir
Tar zcvf system$now.tar.gz system$now.dmp system$now.log--remove-files
find/orabackup/-mtime +7-exec/bin/rm-rf ' {} ';
This script is to back up the system user data, then compress it into a tar package, and then delete files larger than 7 days in the backup directory
This article is from the "It~ Migrant Workers" blog, please be sure to keep this source http://429268437.blog.51cto.com/4870929/1773908
Share a script to backup Oracle to local disk under Linux exp, reserved for 7 days