Web site Upgrade Backup script

Source: Internet
Author: User
#!/bin/bash# General Web page upgrade is a direct replacement of the root directory of the corresponding files, so before upgrading to backup the corresponding directory or file can be web=/var/www/html #web根目录dd = "/data/admin/ps/css/bbs*" # The directories and files to be backed up under the Web root, the directories or files to be backed up, and the variables to be written to, you can use the * wildcard character. Mkdir-p/web_bak &>/dev/null #创建备份所在的目录for dd in $dd;d o #列表循环date_bak =$ (date +%y%m%d-%h%m%s) mkdir-p/web_bak/$da Te_bak &>/dev/nullcp-rfp $web $dd/web_bak/$date _bak &>/dev/null #用cp命令备份, here with-R recursive replication,-F forcibly copying files or directories,-p Preserves file properties. # Of course, this CP copy backup, you can compress the backup with tar, change the command to do


Web site Upgrade Backup script

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.