DB2 database backup script in Linux

Source: Internet
Author: User

DB2 database backup script in Linux

DB2 database backup script in Linux

The script runs under the root user:
 
The content of backupDB2Task. sh is as follows:
 
Datedir = 'date + % Y-% m-% d'
Delete_date = 'date + % Y-% m-% d -- date = '7 days ago''
Backupdir =/home/backup
Backupdir1 =/home/backupdb2
 
Mkdir $ backupdir/$ datedir/
Chown-R db2inst1 $ backupdir/$ datedir
 
Su-db2inst1-c/home/backupdb2/backupDB2.sh
 
Echo ------------- start to compress -----------
Cd $ backupdir/$ datedir/
Tar-zcvf $ backupdir/$ datedir. tgz *.*
Cd $ backupdir
Rm-rf $ datedir
Echo compression ended !!!
 
Echo --------------- delete a file a month ago ----------------------------
Echo path of the folder where the file to be processed is located
Cd $ backupdir
Rm-rf $ delete_date.tgz
 
Exit

DB2 database performance adjustment and optimization (1st and 2) PDF

DB2 database performance optimization

DB2 9.7 for Linux 5.4 Installation Steps

This article permanently updates the link address:

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.