Automatically compress backup database files to a specified server

Source: Internet
Author: User

The database server used by the company is backed up every day, before manually compressing and then copying one copy to another.

No matter what, you decide to use a script to automatically back up and copy

There is a lot of information on the Internet, Baidu a bit

    1. Environment Introduction

Database backup files are stored under D:\beife\

A server with a network segment as a backup of compressed files

2. compressing documents

Install the WinRAR software first and determine the path, which you will need to configure in the system environment variables later

I will first map a network share folder of the storage server to disk L, then create a new TXT file, enter the following command

RAR A-DF-AGYYYY-MM-DD l:\ D:\oracle\bf\*.*

Files saved in. bat format

The meaning of the above command is to automatically compress the \oracle\bf\ file under the D disk and save it in the L packing directory, and then delete the source file after compression.

The compressed file is named 2016-xx-xx

Setup is required because the system cannot automatically recognize WinRAR commands

Right click on Computer click Properties > Advanced system settings > Environment variables

You can see path under administrator user variable, and if not, create a new installation path named path with a value of winrar

My installation path here is C:\Program Files\winrar, click Save to

3. Create a Scheduled task

Then open Task Scheduler

Create a new task with the name winrar

Then configure it as you want

Since our database files are automatically backed up 4:00 every day, I set a daily 7:00 to execute the bat file.

At this point, the automatic compression of the database files to the specified server folder is complete

Automatically compress backup database files to a specified server

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.